diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-06 10:26:39 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-08-06 10:58:36 +0200 |
commit | a3b5e78af3696f807e54bc4b11e559bbd9b6ba1e (patch) | |
tree | 037c42e9a7a637fba9be5d52800afba402eb9df2 /scripts | |
parent | 5c145fe7ab6c1e975f5d43391316e8db9ca31974 (diff) | |
download | PeerTube-a3b5e78af3696f807e54bc4b11e559bbd9b6ba1e.tar.gz PeerTube-a3b5e78af3696f807e54bc4b11e559bbd9b6ba1e.tar.zst PeerTube-a3b5e78af3696f807e54bc4b11e559bbd9b6ba1e.zip |
Analyze embed too with bundlewatch
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/client.sh | 5 | ||||
-rwxr-xr-x | scripts/build/embed.sh | 3 | ||||
-rwxr-xr-x | scripts/client-report.sh | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/scripts/build/client.sh b/scripts/build/client.sh index 254ca4364..878de60df 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh | |||
@@ -33,6 +33,7 @@ pre_build_hook | |||
33 | additionalParams="" | 33 | additionalParams="" |
34 | if [ ! -z ${1+x} ] && [ "$1" == "--analyze-bundle" ]; then | 34 | if [ ! -z ${1+x} ] && [ "$1" == "--analyze-bundle" ]; then |
35 | additionalParams="--namedChunks=true --outputHashing=none" | 35 | additionalParams="--namedChunks=true --outputHashing=none" |
36 | export ANALYZE_BUNDLE=true | ||
36 | fi | 37 | fi |
37 | 38 | ||
38 | 39 | ||
@@ -154,9 +155,7 @@ if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); t | |||
154 | done | 155 | done |
155 | fi | 156 | fi |
156 | 157 | ||
157 | if [ ! -z ${1+x} ] || [ "$1" == "--analyze-bundle" ]; then | 158 | cd ../ && npm run build:embed && cd client/ |
158 | cd ../ && npm run build:embed && cd client/ | ||
159 | fi | ||
160 | 159 | ||
161 | # Copy runtime locales | 160 | # Copy runtime locales |
162 | cp -r "./src/locale" "./dist/locale" | 161 | cp -r "./src/locale" "./dist/locale" |
diff --git a/scripts/build/embed.sh b/scripts/build/embed.sh index 4be2afc25..3fcfc6ba2 100755 --- a/scripts/build/embed.sh +++ b/scripts/build/embed.sh | |||
@@ -4,4 +4,5 @@ set -eu | |||
4 | 4 | ||
5 | cd client | 5 | cd client |
6 | 6 | ||
7 | NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json" | 7 | mkdir -p ./dist/standalone/videos/ |
8 | NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/standalone/videos/embed-stats.json" | ||
diff --git a/scripts/client-report.sh b/scripts/client-report.sh index 76609686b..f280fad20 100755 --- a/scripts/client-report.sh +++ b/scripts/client-report.sh | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | gawk -i inplace 'BEGIN { found=0 } { if (found || $0 ~ /^{/) { found=1; print }}' ./client/dist/embed-stats.json | 5 | gawk -i inplace 'BEGIN { found=0 } { if (found || $0 ~ /^{/) { found=1; print }}' ./client/dist/standalone/videos/embed-stats.json |
6 | 6 | ||
7 | npm run concurrently -- -k \ | 7 | npm run concurrently -- -k \ |
8 | "cd client && npm run webpack-bundle-analyzer -- -p 8888 ./dist/en-US/stats-es2015.json" \ | 8 | "cd client && npm run webpack-bundle-analyzer -- -p 8888 ./dist/en-US/stats-es2015.json" \ |
9 | "cd client && npm run webpack-bundle-analyzer -- -p 8889 ./dist/embed-stats.json" | 9 | "cd client && npm run webpack-bundle-analyzer -- -p 8889 ./dist/standalone/videos/embed-stats.json" |