New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix relative paths with bundleDependencies=false #18488
Fix relative paths with bundleDependencies=false #18488
Conversation
This comment has been minimized.
This comment has been minimized.
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/server.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message is not valid.
The commit message header should start with fix(@angular-devkit/build-angular):
See: https://github.com/angular/angular-cli/blob/master/CONTRIBUTING.md
98ac3b0
to
5b7f32a
Compare
… bundleDependencies=false When `bundleDependencies` is turned off, webpack only bundles modules imported via relative path. Existing check works well for import paths like `'./some/file'`, but fails for imports traversing the dir structure up, like `'../some/file'`.
5b7f32a
to
ac6611c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks LGTM
Thanks for the super quick feedback @alan-agius4 - quite impressive! |
@alan-agius4 I have a followup question though. As I mentioned, despite the incomplete original check for partial path, the builds tend to work well.
Do you think it's possible that this check can potentially give false positives for some arbitrary user module alias, if it also happens to match some internal module from devkit? |
@amakhrov, glad you hear that you had a good experience contributing to the Angular CLI. 😁 I do think that there are some rare edge cases, where using |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When
bundleDependencies
is turned off, webpack is configured to bundle all modules imported via relative path.It works well for import paths like
'./some/file'
but fails for imports traversing the dir structure up, like'../some/file'
.In most cases it would still work well, because of the additional fallback (which checks whether node can resolve this module at all). However, in rare cases this fallback fails (see https://github.com/angular/universal/issues/1792)
Closes: #18493