-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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(build): remove warning about ineffective dynamic import from node_modules #13884
Conversation
Run & review this pull request in StackBlitz Codeflow. |
@chaejunlee I'm not familiar with the build/test processes of this repo, but I'm guessing you will need to modify the existing spec, or perhaps create a one to handle the new use case. Did you take a look at the spec in the original PR? |
@andygup I guess you are mentioning the tests. I didn't through the original PR but I did look into it while preparing this PR. I will go through the original PR again and try again with the test. Thank you! |
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.
i approved these changes that can enhance the build options
I have added documentation for the new config option. To better explain its functionality, I coined the term 'Ineffective Dynamic Import' as mentioned in the original PR #12850. Feedback is welcome! |
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.
I think this is a good idea. I am waiting for these changes to be merged. Then i can use this configuration instead of writing code to monitor these warns with build.rollupOptions.onwarn
.
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.
well done
@bluwy Thank you so much for the review! What I understood is that don't make this feature configurable as a build option, but still implement the Correct me if I am wrong. Until then, I will be removing config bits and refactor the |
Yup, I think we can avoid the option for now, and only implement the fix to not emit warnings for modules that contain |
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! Gonna wait for a bit if another maintainer has thoughts on this (and the option) before merging.
Nice job @chaejunlee!
@bluwy thanks, this fix will significantly reduce the number of warnings for our library and possibly others. We use lazy loading internally in various |
It looks like I see 7a77aaf, but it requires enabling |
@davidAtInleague maybe at the bundler level, this was a suggestion provided in my original issue: https://rollupjs.org/configuration-options/#onwarn |
@andygup thank you so much! That is the solution. |
Description
fixes #13848.
I have added a
BuildOption
variable calledwarnExternalChunkRender
.Default is
false
which disables warning of ineffective dynamic imports of external modules.Setting the value to
true
enables all ineffective dynamic import warnings.Additional context
I not so sure if I added the variable in the right place, or with a right name.
If you give me any feedback about that, I will fix it right away.
If the members approve this, I will be responsible for adding the documentation for this new config variable.
I would like to add some robust testing around this, but I really can't do it because I can't add
node_modules
to the codebase. I checked that theplayground/dynamic-import
has somepackage.json
hack, but the build still targets the user defined files (pkg
) notnode_modules
. If you can guide a little more on this, I will make sure to add testing as well.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).