Skip to content

Commit

Permalink
feat(@ngtools/webpack): remove importFactories option
Browse files Browse the repository at this point in the history
It will just be always be used when applicable.
  • Loading branch information
filipesilva authored and alexeagle committed Apr 22, 2019
1 parent 0f9de92 commit c8d9e54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 2 additions & 7 deletions packages/ngtools/webpack/src/angular_compiler_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export class AngularCompilerPlugin {
private _moduleResolutionCache: ts.ModuleResolutionCache;
private _resourceLoader?: WebpackResourceLoader;
private _discoverLazyRoutes = true;
private _importFactories = false;
private _useFactories = false;
// Contains `moduleImportPath#exportName` => `fullModulePath`.
private _lazyRoutes: LazyRouteMap = {};
Expand Down Expand Up @@ -283,11 +282,6 @@ export class AngularCompilerPlugin {
this._useFactories = true;
}

if (this._useFactories && options.importFactories === true) {
// Only transform imports to use factories with View Engine.
this._importFactories = true;
}

// Default ContextElementDependency to the one we can import from here.
// Failing to use the right ContextElementDependency will throw the error below:
// "No module factory available for dependency type: ContextElementDependency"
Expand Down Expand Up @@ -931,7 +925,8 @@ export class AngularCompilerPlugin {
// Remove unneeded angular decorators.
this._transformers.push(removeDecorators(isAppPath, getTypeChecker));
// Import ngfactory in loadChildren import syntax
if (this._importFactories) {
if (this._useFactories) {
// Only transform imports to use factories with View Engine.
this._transformers.push(importFactory(msg => this._warnings.push(msg)));
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/ngtools/webpack/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export interface AngularCompilerPluginOptions {
// When using Ivy, the string syntax is not supported at all. Thus we shouldn't attempt that.
// This option is also used for when the compilation doesn't need this sort of processing at all.
discoverLazyRoutes?: boolean;
importFactories?: boolean;

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

0 comments on commit c8d9e54

Please sign in to comment.