Fail the build when there is a TS compilation error

This commit is contained in:
Alex Dima 2022-01-10 09:07:34 +01:00
parent 3159d3d6c9
commit 3aebbb1c42
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9

View file

@ -25,12 +25,15 @@ exports.REPO_ROOT = REPO_ROOT;
function tsc(_projectPath) { function tsc(_projectPath) {
const projectPath = path.join(REPO_ROOT, _projectPath); const projectPath = path.join(REPO_ROOT, _projectPath);
console.log(`Launching compiler at ${_projectPath}...`); console.log(`Launching compiler at ${_projectPath}...`);
cp.spawnSync( const res = cp.spawnSync(
process.execPath, process.execPath,
[path.join(__dirname, '../node_modules/typescript/lib/tsc.js'), '-p', projectPath], [path.join(__dirname, '../node_modules/typescript/lib/tsc.js'), '-p', projectPath],
{ stdio: 'inherit' } { stdio: 'inherit' }
); );
console.log(`Compiled ${_projectPath}`); console.log(`Compiled ${_projectPath}`);
if (res.status !== 0) {
process.exit(res.status);
}
} }
exports.tsc = tsc; exports.tsc = tsc;