server.sh 719 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. set -eu
  3. if [ ! -f "./client/dist/en-US/index.html" ]; then
  4. if [ -z ${1+x} ] || [ "$1" != "--skip-client" ]; then
  5. echo "client/dist/en-US/index.html does not exist, compile client files..."
  6. npm run build:client
  7. fi
  8. fi
  9. # Copy locales
  10. mkdir -p "./client/dist"
  11. rm -rf "./client/dist/locale"
  12. cp -r "./client/src/locale" "./client/dist/locale"
  13. mkdir -p "./dist/core/lib"
  14. npm run tsc -- -b -v --incremental server/tsconfig.json
  15. npm run resolve-tspaths:server
  16. cp -r ./server/core/static ./server/core/assets ./dist/core
  17. ./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