From e166cf402a9d2b838d5fba72d5b60117e9265898 Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Mon, 13 Jun 2022 10:53:46 +0200 Subject: [PATCH] use npm workspace flag for the build instead of manually navigate through the folders (#10854) Signed-off-by: Augustin Husson --- web/ui/build_ui.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/web/ui/build_ui.sh b/web/ui/build_ui.sh index d395fc0ec..b59d81de4 100644 --- a/web/ui/build_ui.sh +++ b/web/ui/build_ui.sh @@ -14,28 +14,24 @@ # limitations under the License. set -e -current=$(pwd) + if ! [[ -w $HOME ]] then export npm_config_cache=$(mktemp -d) fi -buildOrder=(module/lezer-promql module/codemirror-promql) +buildOrder=(lezer-promql codemirror-promql) function buildModule() { for module in "${buildOrder[@]}"; do - cd "${module}" echo "build ${module}" - npm run build - cd "${current}" + npm run build -w "${module}" done } function buildReactApp() { - cd react-app echo "build react-app" - npm run build - cd "${current}" + npm run build -w react-app rm -rf ./static/react mv ./react-app/build ./static/react }