Skip to content

Commit 4f35b09

Browse files
clydinfilipesilva
authored andcommitted
refactor(@ngtools/webpack): support webpack 4 resolveDependencies call
1 parent ec5c9bc commit 4f35b09

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/@ngtools/webpack/src/angular_compiler_plugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ export class AngularCompilerPlugin implements Tapable {
567567
// TODO: check if we can't just leave it as is (angularCoreModuleDir).
568568
result.resource = path.join(this._basePath, '$$_lazy_route_resource');
569569
result.dependencies.forEach((d: any) => d.critical = false);
570-
result.resolveDependencies = (_fs: any, _resource: any, _recursive: any,
570+
result.resolveDependencies = (_fs: any, _resourceOrOptions: any, recursiveOrCallback: any,
571571
_regExp: RegExp, cb: any) => {
572572
const dependencies = Object.keys(this._lazyRoutes)
573573
.map((key) => {
@@ -580,6 +580,10 @@ export class AngularCompilerPlugin implements Tapable {
580580
}
581581
})
582582
.filter(x => !!x);
583+
if (typeof cb !== 'function' && typeof recursiveOrCallback === 'function') {
584+
// Webpack 4 only has 3 parameters
585+
cb = recursiveOrCallback;
586+
}
583587
cb(null, dependencies);
584588
};
585589
return callback(null, result);

0 commit comments

Comments
 (0)