-
Notifications
You must be signed in to change notification settings - Fork 101
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
How to subscribe css modules rule? #41
Comments
Hey, are you sure you want to do this? 😸 CSS modules are actually pretty amazing – the ugly hash only shows up for development. For production, the selectors are compressed to much shorter, unique selectors. This will often save bytes on the classnames alone 👍 You can inspect the classNames on As for actually disabling these, you have two options:
Also, simply running config.module.rules.forEach(rule => {
if (Array.isArray(rule.use)) {
rule.use.forEach(obj => {
if (obj.loader && obj.loader === 'css-loader') {
obj.options.modules = false; // DISABLE
}
});
}
}); Hope that helps! |
I don't really like to work with hashes on my CSS, but it's a personal thing, nothing more than this hahaha. Thank you very much for this, solved my problem!! |
Yeah, I can relate 😆 I didn't like CSS modules at all at first, but I've definitely warmed up to them since. Great! 🙌 |
Hello, I need to remove the css generating with a hash on the end of each element.
How can I do that? I already tried just pushing into the rules but still not subscribe, the classes are still generating with hashes.
Code:
Evidence:
The text was updated successfully, but these errors were encountered: