-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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: support css esModule generator options #18357
Conversation
For maintainers only:
|
// TODO webpack 6: remove /\[moduleid\]/.test | ||
if ( | ||
/\[id\]/.test(this.localIdentName) || | ||
/\[moduleid\]/.test(this.localIdentName) |
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 we can improve it in future PRs
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 don't think we really need the esModule
option here, let's do it always, because we already return reasons in getConcatenationBailoutReason
Could you elaborate? Actually I didn't understand what you mean. Did you mean we don't need the |
Sorry for delay, I mean we will work like |
This is derived from an Rspack issue (sorry it is in Chinese), the component library in the user-imported node_modules uses the following code: var _style = _interopRequireDefault(require("./style.less"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
_style["default"].foo; Transformed by Babel from the following code: import style from "./style.less";
style.foo; So if This case should be relatively rare because most packages on npm generally handle CSS Modules and Less themselves, rather than leaving it to users to handle as in this case. However, there are still some packages that do this, particularly those published on the company's intranet. (Some companies may have a unified framework that handles this on the user side instead of on the library side) |
@ahabhgk thank you, got it, let's remove |
@ahabhgk Thanks for your update. I labeled the Pull Request so reviewers will review it again. @alexander-akait Please review the new changes. |
Thank you |
What kind of change does this PR introduce?
feature, introduce
esModule: false
for css generator optionsDid you add tests for your changes?
Added
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
esModule css generator options