]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/build/client.sh
Test bundlewatch
[github/Chocobozzz/PeerTube.git] / scripts / build / client.sh
index 05c40b5bbac07d71c0d1fd12edef4b4f9a1a33f6..75da6765c4b3ac5e7e6050b1b949a8d287b1c453 100755 (executable)
@@ -30,17 +30,29 @@ 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")
+    elif [ ! -z ${1+x} ] && [ "$1" == "--light-vi" ]; then
+        languages=(["vi"]="vi-VN")
+    elif [ ! -z ${1+x} ] && [ "$1" == "--light-kab" ]; then
+        languages=(["kab"]="kab")
     elif [ ! -z ${1+x} ] && [ "$1" == "--light-th" ]; then
         languages=(["th"]="th-TH")
     elif [ ! -z ${1+x} ] && [ "$1" == "--light-fi" ]; then
@@ -53,6 +65,8 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
         languages=(["el"]="el-GR")
     elif [ ! -z ${1+x} ] && [ "$1" == "--light-es" ]; then
         languages=(["es"]="es-ES")
+    elif [ ! -z ${1+x} ] && [ "$1" == "--light-oc" ]; then
+        languages=(["oc"]="oc")
     elif [ ! -z ${1+x} ] && [ "$1" == "--light-pt" ]; then
         languages=(["pt"]="pt-BR")
     elif [ ! -z ${1+x} ] && [ "$1" == "--light-pt-PT" ]; then
@@ -86,6 +100,8 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
     else
         # Supported languages
         languages=(
+            ["ar"]="ar"
+            ["vi"]="vi-VN"
             ["hu"]="hu-HU"
             ["th"]="th-TH"
             ["fi"]="fi-FI"
@@ -93,6 +109,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
             ["gd"]="gd"
             ["el"]="el-GR"
             ["es"]="es-ES"
+            ["oc"]="oc"
             ["pt"]="pt-BR"
             ["pt-PT"]="pt-PT"
             ["sv"]="sv-SE"
@@ -108,6 +125,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
             ["eo"]="eo"
             ["de"]="de-DE"
             ["it"]="it-IT"
+            ["kab"]="kab"
         )
     fi