From 95c5260fae66217731deb6272e76ead079e7aff4 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 19 Nov 2019 20:22:11 -0500 Subject: [PATCH] fix(@angular-devkit/build-angular): resolve lazy route Angular package from project base Closes #16219 (cherry picked from commit 316786df23b3ae6b93ebb88644b2867dd66e9776) --- packages/ngtools/webpack/src/angular_compiler_plugin.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index 5b89e575572d..f3570adf29d5 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -792,7 +792,9 @@ export class AngularCompilerPlugin { if (this._discoverLazyRoutes) { // Add lazy modules to the context module for @angular/core compiler.hooks.contextModuleFactory.tap('angular-compiler', cmf => { - const angularCorePackagePath = require.resolve('@angular/core/package.json'); + const angularCorePackagePath = require.resolve('@angular/core/package.json', { + paths: [this._basePath], + }); // APFv6 does not have single FESM anymore. Instead of verifying if we're pointing to // FESMs, we resolve the `@angular/core` path and verify that the path for the