Skip to content

Commit

Permalink
fix(jsii): Don't skip emit on TS errors when in "watch" mode (#236)
Browse files Browse the repository at this point in the history
In watch mode, users expect to be able to be a little more drafty than when doing a plain compile cycle, as
they may edit code as part of a troubleshooting loop, that may involve for example leaving out unused
imports and the like. This change makes sure the `noEmitOnError` compiler option is set to false when
operating in `watch` mode, so the `.js` files get updated unconditionally.

Fixes #235
  • Loading branch information
RomainMuller committed Sep 19, 2018
1 parent 91074f3 commit 30d1491
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jsii/lib/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class Compiler implements Emitter {
const projectRoot = this.options.projectInfo.projectRoot;
const host = ts.createWatchCompilerHost(
await this._writeTypeScriptConfig(),
COMPILER_OPTIONS,
{ ...COMPILER_OPTIONS, noEmitOnError: false },
{ ...ts.sys, getCurrentDirectory() { return projectRoot; } }
);
const orig = host.afterProgramCreate;
Expand Down

0 comments on commit 30d1491

Please sign in to comment.