From 36619ac8f50daf51a46658f0b530495ba3a0b6bf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 22 Jan 2020 10:00:38 +0100 Subject: [PATCH] Reduce dev commands RAM usage --- package.json | 4 ++-- scripts/ci.sh | 2 +- scripts/dev/client.sh | 6 +++--- scripts/dev/server.sh | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 7f704b5a8..0122a54e4 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,9 @@ "reset-password": "node ./dist/scripts/reset-password.js", "play": "scripty", "dev": "scripty", - "dev:server": "scripty", + "dev:server": "sh ./scripts/dev/server.sh", "dev:embed": "scripty", - "dev:client": "scripty", + "dev:client": "sh ./scripts/dev/client.sh", "dev:cli": "scripty", "start": "node dist/server", "start:server": "node dist/server --no-client", diff --git a/scripts/ci.sh b/scripts/ci.sh index 6281e1aa4..d111b7447 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -9,7 +9,7 @@ fi killall -q peertube || true -perl -0777 -i -pe 's#proxy:(\n\s+)enabled: false\n\s+url: ""#proxy:$1enabled: true$1url: "https://cpy.re:7899"#' config/test.yaml +perl -0777 -i -pe 's#proxy:(\n\s+)enabled: false\n\s+url: ""#proxy:$1enabled: true$1url: "http://188.165.225.149:7899"#' config/test.yaml if [ "$1" = "misc" ]; then npm run build -- --light-fr diff --git a/scripts/dev/client.sh b/scripts/dev/client.sh index cdcf29ef2..bcb8b88f6 100755 --- a/scripts/dev/client.sh +++ b/scripts/dev/client.sh @@ -2,13 +2,13 @@ set -eu -clientCommand="cd client && npm run ng -- serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000" -serverCommand="npm run build:server && NODE_ENV=test npm start" +clientCommand="cd client && node node_modules/.bin/ng serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000" +serverCommand="npm run build:server && NODE_ENV=test node dist/server" if [ ! -z ${1+x} ] && [ "$1" == "--skip-server" ]; then NODE_ENV=test eval $clientCommand else - NODE_ENV=test npm run concurrently -- -k \ + NODE_ENV=test node node_modules/.bin/concurrently -k \ "$clientCommand" \ "$serverCommand" fi diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh index a7fa88fbd..b09a966dd 100755 --- a/scripts/dev/server.sh +++ b/scripts/dev/server.sh @@ -20,6 +20,6 @@ cp "./tsconfig.json" "./dist" npm run tsc -- --incremental --sourceMap cp -r ./server/static ./server/assets ./dist/server -NODE_ENV=test npm run concurrently -- -k \ - "npm run nodemon -- --delay 1 --watch ./dist dist/server" \ - "npm run tsc -- --incremental --sourceMap --preserveWatchOutput -w" +NODE_ENV=test node node_modules/.bin/concurrently -k \ + "node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \ + "node_modules/.bin/tsc --incremental --sourceMap --preserveWatchOutput -w"