diff --git a/conversejs/build-conversejs.sh b/conversejs/build-conversejs.sh index 74504f5a..c3e694b0 100644 --- a/conversejs/build-conversejs.sh +++ b/conversejs/build-conversejs.sh @@ -1,5 +1,11 @@ #!/bin/bash +NO_CONVERSEJS_LOC="" +if [ "$1" = "no-loc" ]; then + echo "We won't generate ConverseJS localization files!" + NO_CONVERSEJS_LOC="1" +fi + set -euo pipefail set -x @@ -94,15 +100,21 @@ fi echo "Building ConverseJS..." cd "$converse_build_dir" -# Note: following lines are from the ConverseJS Makefile (see "make dist" code), where we just replace the "npm run build" with our webpack.livechat.js. -# Ideally this should just be `npm run build`. -# The additional steps are necessary to properly generate JSON chunk files -# from the .po files. The nodeps config uses preset-env with IE11. -# Somehow this is necessary. -npm run nodeps -TMPD=$(mktemp -d) -mv dist/locales $TMPD && npx webpack --config webpack.livechat.js && mv $TMPD/locales/*-po.js dist/locales/ && rm -rf $TMPD -rm dist/converse-no-dependencies.js dist/converse-no-dependencies.js.map +if [ "$NO_CONVERSEJS_LOC" = "1" ]; then + echo "Building without ConverseJS localization files!" + # shortcut to build more quickly for dev purpose (see npm run build:converjs-no-loc) + npx webpack --config webpack.livechat.js +else + # Note: following lines are from the ConverseJS Makefile (see "make dist" code), where we just replace the "npm run build" with our webpack.livechat.js. + # Ideally this should just be `npm run build`. + # The additional steps are necessary to properly generate JSON chunk files + # from the .po files. The nodeps config uses preset-env with IE11. + # Somehow this is necessary. + npm run nodeps + TMPD=$(mktemp -d) + mv dist/locales $TMPD && npx webpack --config webpack.livechat.js && mv $TMPD/locales/*-po.js dist/locales/ && rm -rf $TMPD + rm dist/converse-no-dependencies.js dist/converse-no-dependencies.js.map +fi cd $rootdir diff --git a/package.json b/package.json index 9f0b1890..915633d2 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "clean:light": "rm -rf dist/* support/documentation/content/translations/* support/documentation/i18n/*", "prepare": "npm run clean && npm run build", "build:converse": "bash conversejs/build-conversejs.sh", + "build:converse-no-loc": "bash conversejs/build-conversejs.sh no-loc", "build:prosody": "bash build-prosody.sh", "build:images": "mkdir -p dist/client/images && npx svgo -f assets/images/ -o dist/client/images/", "build:avatars": "./build-avatars.js",