Skip to content

Commit 0480fa0

Browse files
clydinfilipesilva
authored andcommitted
fix(@ngtools/webpack): respect noEmitOnError within AotPlugin
1 parent bf688ed commit 0480fa0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/@ngtools/webpack/src/loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ export function ngcLoader(this: LoaderContext & { _compilation: any }, source: s
621621

622622
const result = refactor.transpile(compilerOptions);
623623

624-
if (plugin.failedCompilation) {
624+
if (plugin.failedCompilation && plugin.compilerOptions.noEmitOnError) {
625625
// Return an empty string to prevent extra loader errors (missing imports etc).
626626
// Plugin errors were already pushed to the compilation errors.
627627
cb(null, '');

packages/@ngtools/webpack/src/plugin.ts

+5
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ export class AotPlugin implements Tapable {
202202
this._compilerOptions.mapRoot = undefined;
203203
}
204204

205+
// Default noEmitOnError to true
206+
if (this._compilerOptions.noEmitOnError !== false) {
207+
this._compilerOptions.noEmitOnError = true;
208+
}
209+
205210
// Compose Angular Compiler Options.
206211
this._angularCompilerOptions = Object.assign(
207212
{ genDir },

0 commit comments

Comments
 (0)