From 29f148a61381727a432c22a71c7a2b7cc23d9c9e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 2 Feb 2021 15:33:58 +0100 Subject: Add ability to build client with source maps --- scripts/build/client.sh | 7 ++++++- scripts/nightly.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/build/client.sh b/scripts/build/client.sh index 0e7925be5..fd072b18c 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh @@ -43,7 +43,12 @@ rm -rf ./dist ./compiled # Don't build other languages if --light arg is provided if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); then - npm run ng build -- --prod --output-path "dist/build" + additionalParams="" + if [ ! -z ${1+x} ] && [ "$1" == "--source-map" ]; then + additionalParams="--sourceMap=true" + fi + + npm run ng build -- --prod --output-path "dist/build" $additionalParams for key in "${!languages[@]}"; do lang=${languages[$key]} diff --git a/scripts/nightly.sh b/scripts/nightly.sh index c4c6f87b5..5ad603929 100755 --- a/scripts/nightly.sh +++ b/scripts/nightly.sh @@ -18,7 +18,7 @@ today=$(date '+%F') directory_name="peertube-nightly-$today" tar_name="peertube-nightly-$today.tar.xz" -npm run build +npm run build -- --source-map nightly_version="nightly-$today" sed -i 's/"version": "\([^"]\+\)"/"version": "\1-'"$nightly_version"'"/' ./package.json -- cgit v1.2.3