-
-
Notifications
You must be signed in to change notification settings - Fork 608
localIdentName setting should only rename classnames for (s)css module files #1307
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
Comments
No, setting:
means you enable |
Many developers don't use |
Do you mean that you need to webpack rules with the same css loaders with different settings? Something like this:
|
Yes, but I found it some hacky, we prepare new version, maybe we can improve this, I will think about this, I think we should not consider some options to enable modules |
auto works fine unless you don't need to set options, it is the problem |
since the 'auto' option uses a regex to determine if it should use css module logic you would expect that the settings underneath module would only apply on these files. I did find a workaround maybe this could be integrated. Add this function to
However you can not fallback make this option undefined again to fallback on regular hashing in case of production environment. So an env check should be added to this function if you want this. Also i find this solution rather hacky because you need to create the hashes yourself. Maybe you can work with this ? |
It is breaking change and can be changed only for the next major release, I will think |
Ok thanks |
We improve our docs for
Why? To avoid misleading, when you explicit CSS enable modules, i.e. Feel free to feedback. |
Yes this works! thanks for looking into this. |
Expected Behavior
When setting a
localIdentName
in themodules
config it should only rename classnames for (s)css modules.So files that have .module.(s)css
Actual Behavior
It also renames classnames in scss that are passed as webpack entry. So app.scss has some global css and all of the sudden they get hashed. But the react components have the actual classnames and not a reference to imported styles.
Code
How Do We Reproduce?
Create some global css and set this as an entry along with a js entry:
and create a css module which you import in the js file.
With the loader settings above you would expect that only the module css would get renamed.
The text was updated successfully, but these errors were encountered: