@@ -94,7 +94,6 @@ export class AngularCompilerPlugin {
94
94
private _moduleResolutionCache : ts . ModuleResolutionCache ;
95
95
private _resourceLoader ?: WebpackResourceLoader ;
96
96
private _discoverLazyRoutes = true ;
97
- private _importFactories = false ;
98
97
private _useFactories = false ;
99
98
// Contains `moduleImportPath#exportName` => `fullModulePath`.
100
99
private _lazyRoutes : LazyRouteMap = { } ;
@@ -283,11 +282,6 @@ export class AngularCompilerPlugin {
283
282
this . _useFactories = true ;
284
283
}
285
284
286
- if ( this . _useFactories && options . importFactories === true ) {
287
- // Only transform imports to use factories with View Engine.
288
- this . _importFactories = true ;
289
- }
290
-
291
285
// Default ContextElementDependency to the one we can import from here.
292
286
// Failing to use the right ContextElementDependency will throw the error below:
293
287
// "No module factory available for dependency type: ContextElementDependency"
@@ -931,7 +925,8 @@ export class AngularCompilerPlugin {
931
925
// Remove unneeded angular decorators.
932
926
this . _transformers . push ( removeDecorators ( isAppPath , getTypeChecker ) ) ;
933
927
// Import ngfactory in loadChildren import syntax
934
- if ( this . _importFactories ) {
928
+ if ( this . _useFactories ) {
929
+ // Only transform imports to use factories with View Engine.
935
930
this . _transformers . push ( importFactory ( msg => this . _warnings . push ( msg ) ) ) ;
936
931
}
937
932
}
0 commit comments