PeerTube/scripts/build/client.sh

27 lines
775 B
Bash
Raw Normal View History

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