server.sh 782 B

12345678910111213141516171819202122232425262728
  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 -- --light
  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. rm -rf "./dist"
  14. mkdir "./dist"
  15. cp "./tsconfig.json" "./dist"
  16. npm run tsc -- --incremental --sourceMap
  17. cp -r ./server/static ./server/assets ./dist/server
  18. cp -r "./server/lib/emails" "./dist/server/lib"
  19. NODE_ENV=test node node_modules/.bin/concurrently -k \
  20. "node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \
  21. "node_modules/.bin/tsc --incremental --sourceMap --preserveWatchOutput -w"