From 33a53638c2b7a41a4e39558582f604d3036d4fa3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Aug 2021 10:32:40 +0200 Subject: [PATCH] Embed stats only when needed --- scripts/build/client.sh | 2 ++ scripts/build/embed.sh | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build/client.sh b/scripts/build/client.sh index 5ecbff28d..e891b217c 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh @@ -69,6 +69,8 @@ else additionalParams="" if [ ! -z ${1+x} ] && [ "$1" == "--analyze-bundle" ]; then additionalParams="--namedChunks=true --outputHashing=none" + + # For webpack export ANALYZE_BUNDLE=true fi diff --git a/scripts/build/embed.sh b/scripts/build/embed.sh index a243ce640..66044759f 100755 --- a/scripts/build/embed.sh +++ b/scripts/build/embed.sh @@ -6,4 +6,8 @@ cd client mkdir -p ./dist/standalone/videos/ -NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/standalone/videos/embed-stats.json" +if [ ! -z ${ANALYZE_BUNDLE+x} ] && [ "$ANALYZE_BUNDLE" == true ]; then + NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/standalone/videos/embed-stats.json" +else + NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production +fi