From 3aebbb1c42ed135244d42910a193100ba0124ebb Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 10 Jan 2022 09:07:34 +0100 Subject: [PATCH] Fail the build when there is a TS compilation error --- build/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/utils.js b/build/utils.js index 932956a4..6700fd09 100644 --- a/build/utils.js +++ b/build/utils.js @@ -25,12 +25,15 @@ exports.REPO_ROOT = REPO_ROOT; function tsc(_projectPath) { const projectPath = path.join(REPO_ROOT, _projectPath); console.log(`Launching compiler at ${_projectPath}...`); - cp.spawnSync( + const res = cp.spawnSync( process.execPath, [path.join(__dirname, '../node_modules/typescript/lib/tsc.js'), '-p', projectPath], { stdio: 'inherit' } ); console.log(`Compiled ${_projectPath}`); + if (res.status !== 0) { + process.exit(res.status); + } } exports.tsc = tsc;