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
Razzle SCSS with CSS Modules #625
Comments
take a look at Also if you want to take a loot at my updates to that example (for webpack 4), take a loot at below:
|
I have managed to get it to work, thanks for the help. I'll make a PR with example soon. |
Could you provide a example @MaxGoh |
Bit late to this, but here's what worked for me: const path = require("path");
module.exports = {
modify(config, { target, dev }, webpack) {
for (const rule of config.module.rules) {
if (rule.test && rule.test.toString() === "/\\.module\\.css$/") {
const scss = { ...rule };
scss.test = /\.scss$/;
scss.include = path.join(__dirname, "src");
scss.use.push({ loader: "sass-loader" });
config.module.rules.push(scss);
break;
}
}
return config;
}
}; |
I'm trying to implement CSS Modules with SCSS.
I manage to get it to modules to work with SCSS. However, I can't do normal imports of SCSS, I have tried pushing multiple rules, and excluding module.scss but it doesn't work. It would be good if anyone here could give me a hand in this.
This is my current working config for only SCSS with modules, but normal import.
Thanks.
The text was updated successfully, but these errors were encountered: