Skip to content

Commit 23abd0d

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

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
@@ -582,7 +582,7 @@ export class AngularCompilerPlugin implements Tapable {
582582
// TODO: check if we can't just leave it as is (angularCoreModuleDir).
583583
result.resource = path.join(this._basePath, '$$_lazy_route_resource');
584584
result.dependencies.forEach((d: any) => d.critical = false);
585-
result.resolveDependencies = (_fs: any, _resource: any, _recursive: any,
585+
result.resolveDependencies = (_fs: any, _resourceOrOptions: any, recursiveOrCallback: any,
586586
_regExp: RegExp, cb: any) => {
587587
const dependencies = Object.keys(this._lazyRoutes)
588588
.map((key) => {
@@ -595,6 +595,10 @@ export class AngularCompilerPlugin implements Tapable {
595595
}
596596
})
597597
.filter(x => !!x);
598+
if (typeof cb !== 'function' && typeof recursiveOrCallback === 'function') {
599+
// Webpack 4 only has 3 parameters
600+
cb = recursiveOrCallback;
601+
}
598602
cb(null, dependencies);
599603
};
600604
return callback(null, result);

0 commit comments

Comments
 (0)