Embed stats only when needed

pull/4337/head
Chocobozzz 2021-08-18 10:32:40 +02:00
parent 64ef55f7c8
commit 33a53638c2
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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