From 345e6b077716915226e92140a0f73300ed54b89a Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 16 Dec 2016 15:18:10 -0800 Subject: [PATCH] fix(@ngtools/webpack): report errors during codegen (#3608) And let the build finish. --- packages/@ngtools/webpack/src/plugin.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@ngtools/webpack/src/plugin.ts b/packages/@ngtools/webpack/src/plugin.ts index 5870f4b56e97..b3d198e71436 100644 --- a/packages/@ngtools/webpack/src/plugin.ts +++ b/packages/@ngtools/webpack/src/plugin.ts @@ -213,7 +213,8 @@ export class AotPlugin implements Tapable { (_: any, cb: any) => cb(null, this._lazyRoutes)); return callback(null, result); - }).catch((err) => callback(err)); + }, () => callback(null)) + .catch(err => callback(err)); }); }); @@ -228,9 +229,7 @@ export class AotPlugin implements Tapable { // Virtual file system. compiler.resolvers.normal.plugin('resolve', (request: any, cb?: (err?: any) => void) => { if (request.request.match(/\.ts$/)) { - this.done - .then(() => cb()) - .catch((err) => cb(err)); + this.done.then(() => cb(), () => cb()); } else { cb(); } @@ -320,6 +319,7 @@ export class AotPlugin implements Tapable { }) .then(() => cb(), (err: any) => { compilation.errors.push(err); + cb(); }); } }