From 102cd86a8ea33bf1c3dc8cb75b8727c2f239c3d5 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 27 Sep 2019 16:59:24 +0100 Subject: [PATCH] fix(@angular-devkit/build-angular): don't double process factory files --- .../src/angular-cli-files/models/webpack-configs/common.ts | 2 ++ packages/ngtools/webpack/src/compiler_host.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts b/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts index 984efbe979a1..f05aff592888 100644 --- a/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts +++ b/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts @@ -468,6 +468,8 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration { }, { test: /\.js$/, + // Factory files are processed by BO in the rules added in typescript.ts. + exclude: /(ngfactory|ngstyle)\.js$/, ...buildOptimizerUseRule, }, { diff --git a/packages/ngtools/webpack/src/compiler_host.ts b/packages/ngtools/webpack/src/compiler_host.ts index ae898e43d1e2..93bf04cff1d2 100644 --- a/packages/ngtools/webpack/src/compiler_host.ts +++ b/packages/ngtools/webpack/src/compiler_host.ts @@ -144,7 +144,7 @@ export class WebpackCompilerHost implements ts.CompilerHost { if (!exists) { // At this point we're only looking at resource files (html/css/scss/etc). // If the original was deleted, we should delete the virtual files too. - // If the original it wasn't deleted we should leave them to be overwritten, because webpack + // If the original wasn't deleted we should leave them to be overwritten, because webpack // might begin the loading process before our plugin has re-emitted them. for (const ext of this._virtualStyleFileExtensions) { const virtualFile = (fullPath + ext) as Path;