Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Prevent emit upon errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alippai committed Nov 3, 2018
1 parent 7819ca1 commit 1d1e63a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ import * as rollup from 'rollup';

const program_es5 = ts.createProgram(['src/entry-export_all.ts'], options_es5.options);
const program_es8 = ts.createProgram(['src/entry-export_all.ts'], options_es8.options);
program_es5.emit();
program_es8.emit();
const result_es5 = program_es5.emit();
if (result_es5.emitSkipped) {
throw new Error(result_es5.diagnostics[0].messageText);
}
const result_es8 = program_es8.emit();
if (result_es8.emitSkipped) {
throw new Error(result_es8.diagnostics[0].messageText);
}

// Copy non-ts resources
await fs.copy('src/aes/aes.asm.js', 'dist_es5/aes/aes.asm.js');
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"target": "es2017",
"lib": ["es5", "dom", "dom.iterable", "es6"],
"noEmit": false,
"noEmitOnError": true,
"strict": true,
"sourceMap": false,
"declaration": true,
Expand Down

0 comments on commit 1d1e63a

Please sign in to comment.