-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
support check chunk-name format only in dynamic-import-chunkname rule #2941
Comments
You want to forbid webpack chunk name comments? |
I think he wants to allow empty |
That’s the default behavior of the language without the rule enabled tho. |
I think he wants to allow empty |
Hmm, ok - what's the use case? When would you want some dynamic imports handled by webpack but some not? |
Take the following as example, when dynamic string included, a chunk name is good to have. import(
/* webpackChunkName: "my-chunk-name" */
`./locale/${language}`
); But then the expression itself is static, no need to change it. |
The staticness or dynamicness of the import specifier isn't relevant to webpack tho. This rule was created because in a codebase that's using webpack dynamic import code splitting, every single dynamic import needs to have a chunk name identified. |
When I wrap dynamic import with loadable, e.g. loadable(() => import("some-module")) it provides a babel-plugin or swc-plugin to automatic add automatic generate chunkName only enabled when webpackChunkName not found in |
If you’re using that plugin, why would you use this rule? |
If use these plugins:
Because this rule also check webpackChunkName format. If I already defined |
OK, thanks, that's at least a use case :-) I'll wait til I hear @JiangWeixian's use case before I decide anything tho. |
Not sure what's your meaning, @JiangWeixian has already provided his use case. |
I don't see where; the OP only asks for a solution. A use case is the "why" - the problem they're having and why they're having it. |
What does this mean? |
It means that you provided the first motivation - reason/justification - for making any changes here, since the OP still hasn't provided any. |
ah thanks, i got confused :-) In that case, an option that ignores missing comments would be fine. |
@JiangWeixian So this feature is ready to be implemented. |
Thanks for awesome works :)
Currently dynamic-import-chunkname rule require webpack chunk name, will report error if not exit.
Is able to add a option to check chunk-name format only, if webpack chunk name not exit is ok.
Currently
dynamic-import-chunkname
will throw error forI want to add a option to make
I glad like open a PR for this feature.
Related un-ts#21
The text was updated successfully, but these errors were encountered: