]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Embed stats only when needed
authorChocobozzz <me@florianbigard.com>
Wed, 18 Aug 2021 08:32:40 +0000 (10:32 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 18 Aug 2021 08:32:40 +0000 (10:32 +0200)
scripts/build/client.sh
scripts/build/embed.sh

index 5ecbff28d44a8ce0d7e07c32c7607b92797185e5..e891b217ccef72a2601a9200d2aa179ca32997a4 100755 (executable)
@@ -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
 
index a243ce64095301f174871a8ac7035cdc71263af3..66044759fd228e77cec930426a366e3b8da60df5 100755 (executable)
@@ -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