2023-08-26 13:45:29 +00:00
|
|
|
#!/bin/sh
|
2023-08-26 12:54:15 +00:00
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2023-08-26 13:03:26 +00:00
|
|
|
echo "🦔 > Clear dist directory.."
|
2023-08-26 12:54:15 +00:00
|
|
|
rm -rf dist
|
|
|
|
|
2023-08-26 13:03:26 +00:00
|
|
|
echo "🦔 > Compile to CJS.."
|
2023-08-26 12:54:15 +00:00
|
|
|
tsc --project tsconfig.cjs.json
|
|
|
|
|
2023-08-26 13:03:26 +00:00
|
|
|
echo "🦔 > Compile to ESM.."
|
2023-08-26 12:54:15 +00:00
|
|
|
tsc --project tsconfig.esm.json
|
|
|
|
|
2023-08-26 13:03:26 +00:00
|
|
|
echo "🦔 > Fix CJS package.json.."
|
2023-08-26 12:54:15 +00:00
|
|
|
cat > dist/cjs/package.json <<!EOF
|
|
|
|
{
|
|
|
|
"type": "commonjs"
|
|
|
|
}
|
|
|
|
!EOF
|
|
|
|
|
2023-08-26 13:03:26 +00:00
|
|
|
echo "🦔 > Fix ESM package.json.."
|
2023-08-26 12:54:15 +00:00
|
|
|
cat > dist/esm/package.json <<!EOF
|
|
|
|
{
|
|
|
|
"type": "module"
|
|
|
|
}
|
|
|
|
!EOF
|
|
|
|
|
2023-08-26 13:03:26 +00:00
|
|
|
echo "🦔 > Done!"
|