From 30d1491f1762e9473d512e73f47b305dce8281fc Mon Sep 17 00:00:00 2001 From: Romain Marcadier-Muller Date: Wed, 19 Sep 2018 14:53:04 +0200 Subject: [PATCH] fix(jsii): Don't skip emit on TS errors when in "watch" mode (#236) 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 --- packages/jsii/lib/compiler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jsii/lib/compiler.ts b/packages/jsii/lib/compiler.ts index 9fd4229cd1..9b52910c29 100644 --- a/packages/jsii/lib/compiler.ts +++ b/packages/jsii/lib/compiler.ts @@ -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;