feat(css): allow to use default and named export#18271
Merged
alexander-akait merged 2 commits intomainfrom Apr 2, 2024
Merged
Conversation
Contributor
|
For maintainers only:
|
6 tasks
Contributor
|
Good idea, looks good to me |
Contributor
|
I've created an issue to document this in webpack/webpack.js.org. |
|
@alexander-akait Do we need to update any option from css-loader, e.g. the option |
Member
Author
|
@nyngwang Yeah, let's check it and add tests, anyway I want to make |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
feature - allow to use default and named export
The same as requested here - webpack/mini-css-extract-plugin#1084
/cc @ahabhgk What do you think about it?
The main idea - allow to easy migrate from default to named, by default it is disabled (because we use only named export), but if developers have a lot of code, it is not easy to migrate fast, so developer can disable named export and use both of them
Did you add tests for your changes?
Yes
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
When named export is disabled for CSS modules you can get classes using (we redirect named export for better DX, it will allow to migrate from default export to named smoothly):
When
namedExport: true, you can use only named export.