From a8fa47ebef413f9331dcb7798d622a6779dbcf93 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 19:42:54 +0530 Subject: [PATCH] build: reliable asset building in production (backport #18133) (#18136) * build: move all devDependencies to Dependencies These are real dependencies without which you can't locally build apps. (cherry picked from commit 06aaaaaedfac83ed623d2b1c6b653afe3fb79e1a) * fix: fail code when build fails in production In production it is useful to fail with proper exit code. To avoid silently pushing bad assets in built pipelines. (cherry picked from commit 1ba99396bcdb9ef5178edf3063153f2150dc27d8) Co-authored-by: Ankush Menat --- esbuild/esbuild.js | 2 +- package.json | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/esbuild/esbuild.js b/esbuild/esbuild.js index 56910cbcac..69e479a6ff 100644 --- a/esbuild/esbuild.js +++ b/esbuild/esbuild.js @@ -103,7 +103,7 @@ async function execute() { log_error("There were some problems during build"); log(); log(chalk.dim(e.stack)); - if (process.env.CI) { + if (process.env.CI || PRODUCTION) { process.kill(process.pid); } return; diff --git a/package.json b/package.json index c4ba042a89..ca675eb538 100644 --- a/package.json +++ b/package.json @@ -61,9 +61,7 @@ "vue": "2.6.14", "vue-router": "^2.0.0", "vuedraggable": "^2.24.3", - "vuex": "3" - }, - "devDependencies": { + "vuex": "3", "@frappe/esbuild-plugin-postcss2": "^0.1.3", "@vue/component-compiler": "^4.2.4", "autoprefixer": "10",