]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - scripts/build/client.sh
Render CSS/title/description tags on server side
[github/Chocobozzz/PeerTube.git] / scripts / build / client.sh
CommitLineData
10e63b68 1#!/bin/bash
b20b5fed 2
0e4ffb4b
LA
3set -eu
4
5cd client
b20b5fed 6
94edfc3b 7rm -rf ./dist ./compiled
d61e8153 8
96bb360d 9defaultLanguage="en_US"
989e526a
C
10npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
11mv "./dist/$defaultLanguage/assets" "./dist"
12
e032aec9
C
13# Don't build other languages if --light arg is provided
14if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
15 # Supported languages
16 languages=("fr_FR" "eu_ES" "ca_ES" "cs_CZ" "eo")
17
18 for lang in "${languages[@]}"; do
19 npm run ng build -- --prod --i18n-file "./src/locale/target/angular_$lang.xml" --i18n-format xlf --i18n-locale "$lang" \
20 --output-path "dist/$lang/" --deploy-url "/client/$lang/"
21
22 # Do no duplicate assets
23 rm -r "./dist/$lang/assets"
24 done
25fi
989e526a 26
6cca7360 27NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json"
989e526a 28
96bb360d
C
29# Copy runtime locales
30cp -r "./src/locale/target" "./dist/locale"