PeerTube/scripts/build/client.sh

27 lines
813 B
Bash
Raw Normal View History

2018-06-28 07:56:46 -05:00
#!/bin/bash
2018-03-27 03:35:12 -05:00
set -eu
cd client
2017-12-13 10:51:32 -06:00
rm -rf ./dist ./compiled
2017-04-26 14:46:56 -05:00
2018-06-06 11:17:24 -05:00
defaultLanguage="en_US"
2018-05-31 11:12:15 -05:00
npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
mv "./dist/$defaultLanguage/assets" "./dist"
2018-06-06 11:17:24 -05:00
# Supported languages
languages=("fr_FR" "eu_ES" "ca_ES" "cs_CZ" "eo")
2018-05-31 11:12:15 -05:00
2018-06-28 07:56:46 -05:00
for lang in "${languages[@]}"; do
2018-06-06 11:17:24 -05:00
npm run ng build -- --prod --i18n-file "./src/locale/target/angular_$lang.xml" --i18n-format xlf --i18n-locale "$lang" \
2018-05-31 11:12:15 -05:00
--output-path "dist/$lang/" --deploy-url "/client/$lang/"
# Do no duplicate assets
rm -r "./dist/$lang/assets"
done
2018-06-07 09:50:33 -05:00
NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json"
2018-05-31 11:12:15 -05:00
2018-06-06 11:17:24 -05:00
# Copy runtime locales
cp -r "./src/locale/target" "./dist/locale"