From 7808df91494b2e910f98c300eaecb8f5f13a5c82 Mon Sep 17 00:00:00 2001 From: Fabien Mercier Date: Sat, 8 Jun 2024 11:47:23 +0200 Subject: [PATCH] Update Yarn 2 install command with a production flag --- lib/dependencies.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/dependencies.sh b/lib/dependencies.sh index be39d8726..bc2dd999b 100644 --- a/lib/dependencies.sh +++ b/lib/dependencies.sh @@ -153,11 +153,16 @@ yarn_node_modules() { yarn_2_install() { local build_dir=${1:-} + local production=${YARN_PRODUCTION:-false} echo "Running 'yarn install' with yarn.lock" cd "$build_dir" || return - monitor "yarn-2-install" yarn install --immutable 2>&1 + if [ "$production" == "production" ]; then + monitor "yarn-2-install" yarn workspaces focus --production 2>&1 + else + monitor "yarn-2-install" yarn install --immutable 2>&1 + fi } yarn_prune_devdependencies() {