From 6cca7360eb9027e1544f7513df7da4684061ef7e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 7 Jun 2018 16:50:33 +0200 Subject: Reduce bundle sizes --- scripts/build/client.sh | 2 +- scripts/client-report.sh | 6 ++++-- scripts/dev/client.sh | 2 +- scripts/dev/index.sh | 2 +- scripts/e2e.sh | 2 +- scripts/watch/server.sh | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/build/client.sh b/scripts/build/client.sh index d3da7cfcf..58aca437b 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh @@ -21,7 +21,7 @@ for lang in "$languages"; do rm -r "./dist/$lang/assets" done -NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production +NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json" # Copy runtime locales cp -r "./src/locale/target" "./dist/locale" \ No newline at end of file diff --git a/scripts/client-report.sh b/scripts/client-report.sh index 4dd4b418b..df7ccda27 100755 --- a/scripts/client-report.sh +++ b/scripts/client-report.sh @@ -2,6 +2,8 @@ set -eu -cd client +gawk -i inplace 'BEGIN { found=0 } { if (found || $0 ~ /^{/) { found=1; print }}' ./client/dist/embed-stats.json -npm run webpack-bundle-analyzer ./dist/stats.json +npm run concurrently -- -k \ + "cd client && npm run webpack-bundle-analyzer -- -p 8888 ./dist/en_US/stats.json" \ + "cd client && npm run webpack-bundle-analyzer -- -p 8889 ./dist/embed-stats.json" \ No newline at end of file diff --git a/scripts/dev/client.sh b/scripts/dev/client.sh index ecd934888..c630de2c4 100755 --- a/scripts/dev/client.sh +++ b/scripts/dev/client.sh @@ -2,6 +2,6 @@ set -eu -NODE_ENV=test concurrently -k \ +NODE_ENV=test npm run concurrently -- -k \ "npm run watch:client" \ "npm run build:server && NODE_ENV=test npm start" diff --git a/scripts/dev/index.sh b/scripts/dev/index.sh index dcbf62d37..7fc1560ab 100755 --- a/scripts/dev/index.sh +++ b/scripts/dev/index.sh @@ -2,6 +2,6 @@ set -eu -NODE_ENV=test concurrently -k \ +NODE_ENV=test npm run concurrently -- -k \ "npm run watch:client" \ "npm run watch:server" diff --git a/scripts/e2e.sh b/scripts/e2e.sh index 0e70e6e51..1e31cd57c 100755 --- a/scripts/e2e.sh +++ b/scripts/e2e.sh @@ -10,7 +10,7 @@ npm run clean:server:test npm run webpack -- --config webpack/webpack.video-embed.js --mode development ) -concurrently -k -s first \ +npm run concurrently -- -k -s first \ "cd client && npm run ng -- e2e --port 3333" \ "NODE_ENV=test NODE_APP_INSTANCE=1 NODE_CONFIG='{ \"log\": { \"level\": \"warning\" } }' npm start" diff --git a/scripts/watch/server.sh b/scripts/watch/server.sh index badbf3da0..da8bff1da 100755 --- a/scripts/watch/server.sh +++ b/scripts/watch/server.sh @@ -7,6 +7,6 @@ mkdir -p "./client/dist" rm -r "./client/dist/locale" cp -r "./client/src/locale/target" "./client/dist/locale" -NODE_ENV=test concurrently -k \ +NODE_ENV=test npm run concurrently -- -k \ "npm run tsc -- --sourceMap && npm run nodemon -- --delay 2 --watch ./dist dist/server" \ "npm run tsc -- --sourceMap --preserveWatchOutput -w" -- cgit v1.2.3