Skip to content

Commit 95c5260

Browse files
clydindgp1130
authored andcommitted
fix(@angular-devkit/build-angular): resolve lazy route Angular package from project base
Closes #16219 (cherry picked from commit 316786d)
1 parent 8e09b3e commit 95c5260

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/ngtools/webpack/src/angular_compiler_plugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,9 @@ export class AngularCompilerPlugin {
792792
if (this._discoverLazyRoutes) {
793793
// Add lazy modules to the context module for @angular/core
794794
compiler.hooks.contextModuleFactory.tap('angular-compiler', cmf => {
795-
const angularCorePackagePath = require.resolve('@angular/core/package.json');
795+
const angularCorePackagePath = require.resolve('@angular/core/package.json', {
796+
paths: [this._basePath],
797+
});
796798

797799
// APFv6 does not have single FESM anymore. Instead of verifying if we're pointing to
798800
// FESMs, we resolve the `@angular/core` path and verify that the path for the

0 commit comments

Comments
 (0)