You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the expected behavior?
The special comment /*webpackIgnore*/ should have CLI option to keep it in the bundle.
What is motivation or use case for adding/changing the behavior?
I created a JS lib with some dynamic import init, so I placed `/*webpackIgnore:true*/`
inside the import command as described by Webpack not to resolve the path variable
passed into import function.
Now is my app, it uses the lib said above.
When bundling the app, the `webpackIgnore` comments are no longer inside the
lib bundle, and thus Webpack shows warning:
WARNING in ./src/libs/my-lib/dist/lib.bundle.js 1:173737-173746
Critical dependency: the request of a dependency is an expression
In the lib bundle those dynamic imports are still `import(...`, but in the app bundle when
Webpack minifies again, those dynamic imports are `x(...` where x is some minified letter.
I'm guessing of some solutions but don't know how to make it
* Tell webpack to keep the webpackIgnore comment in the lib bundle
* Tell webpack not to show warning when bundling the app (this is dangerous,
coz possibly webpack is resolving the variable passed to import(...) as null?
but practically checked that Webpack leaves those dynamic imports as-is)
Feature request
What is the expected behavior?
The special comment
/*webpackIgnore*/
should have CLI option to keep it in the bundle.What is motivation or use case for adding/changing the behavior?
Stack Overflow link: https://stackoverflow.com/questions/78073590/how-to-keep-the-comment-webpackignoretrue-in-bundle
How should this be implemented in your opinion?
New option in webpack.config.js to allow keeping of all
/*webpackIgnore:true*/
comments.Are you willing to work on this yourself?
No, not familiar with Webpack project source code.
The text was updated successfully, but these errors were encountered: