@@ -94,7 +94,6 @@ export class AngularCompilerPlugin {
9494 private _moduleResolutionCache : ts . ModuleResolutionCache ;
9595 private _resourceLoader ?: WebpackResourceLoader ;
9696 private _discoverLazyRoutes = true ;
97- private _importFactories = false ;
9897 private _useFactories = false ;
9998 // Contains `moduleImportPath#exportName` => `fullModulePath`.
10099 private _lazyRoutes : LazyRouteMap = { } ;
@@ -283,11 +282,6 @@ export class AngularCompilerPlugin {
283282 this . _useFactories = true ;
284283 }
285284
286- if ( this . _useFactories && options . importFactories === true ) {
287- // Only transform imports to use factories with View Engine.
288- this . _importFactories = true ;
289- }
290-
291285 // Default ContextElementDependency to the one we can import from here.
292286 // Failing to use the right ContextElementDependency will throw the error below:
293287 // "No module factory available for dependency type: ContextElementDependency"
@@ -931,7 +925,8 @@ export class AngularCompilerPlugin {
931925 // Remove unneeded angular decorators.
932926 this . _transformers . push ( removeDecorators ( isAppPath , getTypeChecker ) ) ;
933927 // Import ngfactory in loadChildren import syntax
934- if ( this . _importFactories ) {
928+ if ( this . _useFactories ) {
929+ // Only transform imports to use factories with View Engine.
935930 this . _transformers . push ( importFactory ( msg => this . _warnings . push ( msg ) ) ) ;
936931 }
937932 }
0 commit comments