Repository navigation
fix(@angular/build): align lazy route entry names with workspace root for SSR modulepreload - #34372
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for overriding the basePath compiler option in the Angular build process, ensuring it is correctly transformed to a Posix path and passed from esbuild's working directory. It also updates related tests to verify the basePath override and ensure that lazy route entry points match the ɵentryName in the server bundle. Feedback suggests falling back to process.cwd() if build.initialOptions.absWorkingDir is undefined, ensuring basePath aligns with esbuild's effective workspace root.
8291fc5 to
8a02c48
Compare
… for SSR modulepreload Override `compilerOptions.basePath` with `build.initialOptions.absWorkingDir` when initializing the Angular compilation so `lazyRoutesTransformer` computes `ɵentryName` relative to the workspace root rather than the tsconfig directory. This matches the workspace-relative keys in `entryPointToBrowserMapping` used for SSR `modulepreload` link generation when the application's `tsconfig` is not located at the workspace root. Closes angular#34369
8a02c48 to
997bf67
Compare
…ce root for SSR modulepreload
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Override
compilerOptions.basePathwithbuild.initialOptions.absWorkingDirwhen initializing the Angular compilation solazyRoutesTransformercomputesɵentryNamerelative to the workspace root rather than the tsconfig directory. This matches the workspace-relative keys inentryPointToBrowserMappingused for SSRmodulepreloadlink generation when the application'stsconfigis not located at the workspace root.Closes #34369