-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
feat(build): warn dynamic import module with a static import alongside #12850
feat(build): warn dynamic import module with a static import alongside #12850
Conversation
|
9b28228
to
eb95a3c
Compare
eb95a3c
to
d16e2e2
Compare
this.warn( | ||
`\n(!) ${ | ||
module.id | ||
} is dynamically imported by ${module.dynamicImporters | ||
.map((m) => m) | ||
.join( | ||
', ', | ||
)} but also statically imported by ${module.importers | ||
.map((m) => m) | ||
.join( | ||
', ', | ||
)}, dynamic import will not move module into another chunk.\n`, | ||
) |
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.
Should we add a break
after the this.warn
here?
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.
👍🏻 Nice catch. Switched to using .some
instead of a for loop (I start to know why it's hard to understand 😅)
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.
Looks great!
Description
fix #12706. As @bluwy suggested, use rollup's warn to warn the ineffective dynamic import.
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).