svnm / react-router-redux-example

react, redux, react-router, reselect, css-modules
205 stars 54 forks source link

Can't get the classnames to line up correctly #1

Closed jcreamer898 closed 7 years ago

jcreamer898 commented 8 years ago

Love this example repository.

I'm trying to set my own up, but can't seem to shake this checksum error.

I have cmrh.conf.js with...

module.exports = {
  generateScopedName: "[name]__[local]___[hash:base64:5]",
};

And in my webpack.config...

loader: ExtractTextPlugin.extract("style", "css?modules&localIdentName=[name]_[local]__[hash:base64:5]"),

Any ideas?

Thanks!

svnm commented 8 years ago

I think you have to make sure you are using the css-modules-require-hook/preset as in the server.js

require('css-modules-require-hook/preset');

This should work okay and when I clone and run the repo I don't have an issue at the moment. Did you make any updates or is it just running it on first clone?

The usage for css modules require hook is as documented in sullenor's demo hope this helps

jcreamer898 commented 8 years ago

I tried to retro fit an app I'm working on with it and can't quite get it. I tried the preset and can't quite get the class names to match. 

On Wed, Mar 16, 2016 at 7:19 PM -0700, "Steven Iseki Martin" notifications@github.com wrote:

I think you have to make sure you are using the css-modules-require-hook/preset as in the server.js

require('css-modules-require-hook/preset');

This should work okay and when I clone and run the repo I don't have an issue at the moment. Did you make any updates or is it just running it on first clone?

The usage for css modules require hook is as documented in sullenor's demo hope this helps

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

svnm commented 8 years ago

just another note as I do remember running into this issue when I set up this example. I needed to ensure I had the cmrh.conf.js file defined in the project, although I was not sure why. It does look like the css loader is defined differently in yours, otherwise not sure what else might be different in your setup.

yours loader: ExtractTextPlugin.extract("style", "css?modules&localIdentName=[name]_[local]__[hash:base64:5]"),

mine: loader: ExtractTextPlugin.extract('style', css?modules&localIdentName=[name]_[local]__[hash:base64:5]!postcss),

svnm commented 7 years ago

This is on the older version, should be working fine now.