]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/build/client.sh
6 defaultLanguage
="en-US"
28 ["zh-Hans"]="zh-Hans-CN"
29 ["zh-Hant"]="zh-Hant-TW"
51 # Don't build other languages if --light arg is provided
52 if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); then
54 if [ ! -z ${1+x} ] && [ "$1" == "--source-map" ]; then
55 additionalParams
="--source-map=true"
58 node
--max_old_space_size=8192 node_modules
/.bin
/ng build
--configuration production
--output-path "dist/build" $additionalParams
60 for key
in "${!languages[@]}"; do
61 lang
=${languages[$key]}
63 mv "dist/build/$key" "dist/$lang"
65 if [ "$lang" != "en-US" ]; then
66 # Do not duplicate assets
67 rm -r "./dist/$lang/assets"
71 mv "./dist/$defaultLanguage/assets" "./dist"
76 if [ ! -z ${1+x} ] && [ "$1" == "--analyze-bundle" ]; then
77 additionalParams
="--named-chunks=true --output-hashing=none"
80 export ANALYZE_BUNDLE
=true
83 node
--max_old_space_size=8192 node_modules
/.bin
/ng build
--localize=false
--output-path "dist/$defaultLanguage/" \
84 --configuration production
--stats-json $additionalParams
87 cp "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest"
89 cd ..
/ && npm run build
:embed
&& cd client
/
91 # Copy runtime locales
92 cp -r "./src/locale" "./dist/locale"