Skip to content

Commit c8d9e54

Browse files
filipesilvaalexeagle
authored andcommitted
feat(@ngtools/webpack): remove importFactories option
It will just be always be used when applicable.
1 parent 0f9de92 commit c8d9e54

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

packages/ngtools/webpack/src/angular_compiler_plugin.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

packages/ngtools/webpack/src/interfaces.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export interface AngularCompilerPluginOptions {
4949
// When using Ivy, the string syntax is not supported at all. Thus we shouldn't attempt that.
5050
// This option is also used for when the compilation doesn't need this sort of processing at all.
5151
discoverLazyRoutes?: boolean;
52-
importFactories?: boolean;
5352

5453
// added to the list of lazy routes
5554
additionalLazyModules?: { [module: string]: string };

0 commit comments

Comments
 (0)