From 76be818e626abf06cea893a4505a43cc2761be86 Mon Sep 17 00:00:00 2001 From: fatme Date: Tue, 30 Jul 2019 08:16:18 +0300 Subject: [PATCH] fix: respect noEmitOnError compiler's option when checking for typescript errors Currently noEmitOnError compiler's option is not respected when executing typescript program. In case when noEmitOnError is false and there are compilation errors in project, no .js files are emitted. However, in this case .js files should be emitted. In case when noEmitOnError is true and there are compilation errors in project, `.js` files should not be emitted. --- packages/ngtools/webpack/src/angular_compiler_plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index 6962bd7bb04d..958ef3fb5ac2 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -1284,7 +1284,7 @@ export class AngularCompilerPlugin { allDiagnostics.push(...gatherDiagnostics(tsProgram, this._JitMode, 'AngularCompilerPlugin._emit.ts', diagMode)); - if (!hasErrors(allDiagnostics)) { + if (!this._compilerOptions.noEmitOnError || !hasErrors(allDiagnostics)) { if (this._firstRun || changedTsFiles.size > 20 || !this._hadFullJitEmit) { emitResult = tsProgram.emit( undefined,