New "npm run build:conversejs-no-loc" to build more quickly when
developing.
This commit is contained in:
parent
2047282b98
commit
922edbe5b3
@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/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 -euo pipefail
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
@ -94,15 +100,21 @@ fi
|
|||||||
echo "Building ConverseJS..."
|
echo "Building ConverseJS..."
|
||||||
cd "$converse_build_dir"
|
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.
|
if [ "$NO_CONVERSEJS_LOC" = "1" ]; then
|
||||||
# Ideally this should just be `npm run build`.
|
echo "Building without ConverseJS localization files!"
|
||||||
# The additional steps are necessary to properly generate JSON chunk files
|
# shortcut to build more quickly for dev purpose (see npm run build:converjs-no-loc)
|
||||||
# from the .po files. The nodeps config uses preset-env with IE11.
|
npx webpack --config webpack.livechat.js
|
||||||
# Somehow this is necessary.
|
else
|
||||||
npm run nodeps
|
# 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.
|
||||||
TMPD=$(mktemp -d)
|
# Ideally this should just be `npm run build`.
|
||||||
mv dist/locales $TMPD && npx webpack --config webpack.livechat.js && mv $TMPD/locales/*-po.js dist/locales/ && rm -rf $TMPD
|
# The additional steps are necessary to properly generate JSON chunk files
|
||||||
rm dist/converse-no-dependencies.js dist/converse-no-dependencies.js.map
|
# 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
|
cd $rootdir
|
||||||
|
|
||||||
|
@ -94,6 +94,7 @@
|
|||||||
"clean:light": "rm -rf dist/* support/documentation/content/translations/* support/documentation/i18n/*",
|
"clean:light": "rm -rf dist/* support/documentation/content/translations/* support/documentation/i18n/*",
|
||||||
"prepare": "npm run clean && npm run build",
|
"prepare": "npm run clean && npm run build",
|
||||||
"build:converse": "bash conversejs/build-conversejs.sh",
|
"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:prosody": "bash build-prosody.sh",
|
||||||
"build:images": "mkdir -p dist/client/images && npx svgo -f assets/images/ -o dist/client/images/",
|
"build:images": "mkdir -p dist/client/images && npx svgo -f assets/images/ -o dist/client/images/",
|
||||||
"build:avatars": "./build-avatars.js",
|
"build:avatars": "./build-avatars.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user