mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 15:02:11 +08:00
refactor(@ngtools/webpack): support webpack 4 resolveDependencies call
This commit is contained in:
parent
935389997e
commit
23abd0d46b
@ -582,7 +582,7 @@ export class AngularCompilerPlugin implements Tapable {
|
|||||||
// TODO: check if we can't just leave it as is (angularCoreModuleDir).
|
// TODO: check if we can't just leave it as is (angularCoreModuleDir).
|
||||||
result.resource = path.join(this._basePath, '$$_lazy_route_resource');
|
result.resource = path.join(this._basePath, '$$_lazy_route_resource');
|
||||||
result.dependencies.forEach((d: any) => d.critical = false);
|
result.dependencies.forEach((d: any) => d.critical = false);
|
||||||
result.resolveDependencies = (_fs: any, _resource: any, _recursive: any,
|
result.resolveDependencies = (_fs: any, _resourceOrOptions: any, recursiveOrCallback: any,
|
||||||
_regExp: RegExp, cb: any) => {
|
_regExp: RegExp, cb: any) => {
|
||||||
const dependencies = Object.keys(this._lazyRoutes)
|
const dependencies = Object.keys(this._lazyRoutes)
|
||||||
.map((key) => {
|
.map((key) => {
|
||||||
@ -595,6 +595,10 @@ export class AngularCompilerPlugin implements Tapable {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(x => !!x);
|
.filter(x => !!x);
|
||||||
|
if (typeof cb !== 'function' && typeof recursiveOrCallback === 'function') {
|
||||||
|
// Webpack 4 only has 3 parameters
|
||||||
|
cb = recursiveOrCallback;
|
||||||
|
}
|
||||||
cb(null, dependencies);
|
cb(null, dependencies);
|
||||||
};
|
};
|
||||||
return callback(null, result);
|
return callback(null, result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user