From: Chocobozzz Date: Wed, 18 Aug 2021 08:32:40 +0000 (+0200) Subject: Embed stats only when needed X-Git-Tag: v3.4.0-rc.1~80 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=33a53638c2b7a41a4e39558582f604d3036d4fa3;hp=64ef55f7c86c450d7264b6e6623c1c298657e9cb;p=github%2FChocobozzz%2FPeerTube.git Embed stats only when needed --- 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