]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/dev/server.sh
Faster ci using compiled ts files
[github/Chocobozzz/PeerTube.git] / scripts / dev / server.sh
1 #!/bin/bash
2
3 set -eu
4
5 if [ ! -f "./client/dist/en-US/index.html" ]; then
6 if [ -z ${1+x} ] || [ "$1" != "--skip-client" ]; then
7 echo "client/dist/en-US/index.html does not exist, compile client files..."
8 npm run build:client -- --light
9 fi
10 fi
11
12 # Copy locales
13 mkdir -p "./client/dist"
14 rm -rf "./client/dist/locale"
15 cp -r "./client/src/locale" "./client/dist/locale"
16
17 rm -rf "./dist"
18
19 mkdir "./dist"
20 cp "./tsconfig.json" "./dist"
21
22 npm run tsc -- --incremental --sourceMap
23 cp -r ./server/static ./server/assets ./dist/server
24 cp -r "./server/lib/emails" "./dist/server/lib"
25
26 NODE_ENV=test node node_modules/.bin/concurrently -k \
27 "node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \
28 "node_modules/.bin/tsc --incremental --sourceMap --preserveWatchOutput -w"