kitze / custom-react-scripts

[DEPRECATED, use customize-cra] Allow custom config for create-react-app without ejecting
https://custom-react-scripts.netlify.com
MIT License
991 stars 96 forks source link

CSS Modules localIdentName configuration #97

Closed helios1138 closed 6 years ago

helios1138 commented 7 years ago

Is it possible to configure localIdentName to be something else? Specifically, to have it be different for development and production builds? Currently it puts a huge hash in both. Preferably, I would like to have something readable, like [name]_[local]____[hash:base64:2] in dev and the default hash (with no options or local names) in prod.

helios1138 commented 7 years ago

any help?

SamMcFaddenBJSS commented 7 years ago

Hello. Thanks for all the work on this package. It would be great to be able to configure the localIdentName or make the default as helios suggests. Any chance of this please? Thanks!

rodrigocfd commented 7 years ago

Right now this configuration is hardcoded right here. It would be nice to have this constant configurable through .env file, with the code being something like this:

localIdentName:
  process.env.REACT_APP_CSS_MODULE_IDENT_NAME ||
  '[sha512:hash:base32]-[name]-[local]',

So that it wouldn't break anything...

What about this, @kitze?