]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/build/client.sh
Test bundlewatch
[github/Chocobozzz/PeerTube.git] / scripts / build / client.sh
index a86404c6f04fe9b53ed167164d975ce2a46f13b8..75da6765c4b3ac5e7e6050b1b949a8d287b1c453 100755 (executable)
@@ -30,19 +30,25 @@ rm -rf ./dist ./compiled
 
 pre_build_hook
 
+additionalParams=""
+if [ ! -z ${1+x} ] && [ "$1" == "--analyze-bundle" ]; then
+    additionalParams="--namedChunks=true --outputHashing=none"
+fi
+
+
 defaultLanguage="en-US"
-npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
+npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json $additionalParams
 mv "./dist/$defaultLanguage/assets" "./dist"
 mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest"
 
 post_build_hook
 
 # Don't build other languages if --light arg is provided
-if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
+if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); then
     if [ ! -z ${1+x} ] && [ "$1" == "--light-hu" ]; then
         languages=(["hu"]="hu-HU")
     elif [ ! -z ${1+x} ] && [ "$1" == "--light-ar" ]; then
-        languages=(["ar"]="ar-001")
+        languages=(["ar"]="ar")
     elif [ ! -z ${1+x} ] && [ "$1" == "--light-vi" ]; then
         languages=(["vi"]="vi-VN")
     elif [ ! -z ${1+x} ] && [ "$1" == "--light-kab" ]; then
@@ -94,7 +100,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
     else
         # Supported languages
         languages=(
-            ["ar"]="ar-001"
+            ["ar"]="ar"
             ["vi"]="vi-VN"
             ["hu"]="hu-HU"
             ["th"]="th-TH"