mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-23 07:19:58 +08:00
feat(@ngtools/webpack): remove importFactories option
It will just be always be used when applicable.
This commit is contained in:
parent
0f9de92dcb
commit
c8d9e545ba
@ -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)));
|
||||
}
|
||||
}
|
||||
|
@ -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 };
|
||||
|
Loading…
x
Reference in New Issue
Block a user