2020-02-19 08:56:24 +01:00
|
|
|
#!/bin/bash
|
2018-03-27 10:35:12 +02:00
|
|
|
|
|
|
|
set -eu
|
2017-06-11 11:29:03 +02:00
|
|
|
|
2019-11-29 13:36:40 +01:00
|
|
|
if [ ! -f "./client/dist/en-US/index.html" ]; then
|
2020-02-19 09:14:28 +01:00
|
|
|
if [ -z ${1+x} ] || [ "$1" != "--skip-client" ]; then
|
|
|
|
echo "client/dist/en-US/index.html does not exist, compile client files..."
|
2022-01-03 16:37:16 +01:00
|
|
|
npm run build:client
|
2020-02-19 09:14:28 +01:00
|
|
|
fi
|
2017-06-11 11:29:03 +02:00
|
|
|
fi
|
|
|
|
|
2019-12-17 15:33:58 +01:00
|
|
|
# Copy locales
|
|
|
|
mkdir -p "./client/dist"
|
|
|
|
rm -rf "./client/dist/locale"
|
|
|
|
cp -r "./client/src/locale" "./client/dist/locale"
|
|
|
|
|
2022-01-03 17:13:11 +01:00
|
|
|
mkdir -p "./dist/server/lib"
|
2019-12-17 15:33:58 +01:00
|
|
|
|
2023-07-31 14:34:36 +02:00
|
|
|
npm run tsc -- -b -v --incremental server/tsconfig.json
|
2022-01-03 17:13:11 +01:00
|
|
|
npm run resolve-tspaths:server
|
|
|
|
|
2023-07-31 14:34:36 +02:00
|
|
|
cp -r ./server/server/static ./server/server/assets ./dist/server
|
|
|
|
cp -r "./server/server/lib/emails" "./dist/server/lib"
|
2019-12-17 15:33:58 +01:00
|
|
|
|
2023-07-31 14:34:36 +02:00
|
|
|
./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=dev node dist/server"' server/tsconfig.json
|