feat(@ngtools/webpack): remove importFactories option

It will just be always be used when applicable.
This commit is contained in:
Filipe Silva 2019-04-22 17:05:35 +01:00 committed by Alex Eagle
parent 0f9de92dcb
commit c8d9e545ba
2 changed files with 2 additions and 8 deletions

View File

@ -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 = {};
@ -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"
@ -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)));
}
}

View File

@ -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 };