-
-
Notifications
You must be signed in to change notification settings - Fork 866
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 and CSS modules #428
Comments
Trying to set up the exact same thing! Edit: not the exact same thing. We're trying to achieve scss + cssmodules. I was using the config from the
I've added the following in the dev
And the following in the production Not perfect but halfway there, I'd say. Here's the complete config so far:
|
Razzle uses the same CSS setup as CRA. You would indeed need to replace the |
Yes this is what I'm doing.
I hopped so too. But I get same error as @rafaelderolez. There are no CSS Modules on server, so css import returns object without classes, when I do |
Interesting. Have to try this out myself |
Ok I fixed it. Working code in the repo. @jaredpalmer do you want PR for that? |
Yeah that’s be great to add as an example |
I rushed to declare a victory. I fixed one problem with webpack, but CSS modules doesn't work 🤦 |
Opened PR. Closing issue #432 |
Hi Guys, Also trying to get CSS modules to work here, tried the example above but only getting an empty object in the front end. Any ideas? |
Did you try #432? |
I'll try it again now. Thanks for getting back :-) |
Yeah, same thing. Just an empty object. No errors. Here are my files: Navigation.css
Navigation.js
razzle.config.js
|
Switching to Navigation.module.css returns: ERROR in ./src/components/Navigation/Navigation.module.css (./node_modules/css-loader??ref--9-1!./node_modules/postcss-loader/lib??postcss!./node_modules/style-loader!./node_modules/css-loader??ref--10-1!./src/components/Navigation/Navigation.module.css) (2:1) Unknown word |
It is |
Yeah, I've been trying that :-(
|
Hm... have no idea, haven't see this before. Something with webpack config |
Yeah very strange. I'll update if I get around it. |
Ha! I'm kicking myself. After banging my head against the keyboard a few times I noticed the module.css was being already processed, and when I added the duplicated rule things went bananas! Thanks for the help though. For prosperity it's worth noticing that css modules seem to be already being processed by Razzle/CRA without the need of a new razzle config. Unless I've done something really crazy with my local install :-) |
I'm trying to make razzle work with CSS Modules. No Luck yet. Any advice?
As as I will manage to do it, can create PR to examples. Current code https://github.com/stereobooster/razzle-cssmodules
Thanks for awesome project.
The text was updated successfully, but these errors were encountered: