From 1ba99396bcdb9ef5178edf3063153f2150dc27d8 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 14 Sep 2022 19:33:23 +0530 Subject: [PATCH] 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. --- esbuild/esbuild.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;