server.sh 719 B

12345678910111213141516171819202122232425
  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/server/lib"
  14. npm run tsc -- -b -v --incremental
  15. npm run resolve-tspaths:server
  16. cp -r ./server/static ./server/assets ./dist/server
  17. cp -r "./server/lib/emails" "./dist/server/lib"
  18. ./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=dev node dist/server"'