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
993 stars 97 forks source link

css module hash size? #120

Open 5angel opened 6 years ago

5angel commented 6 years ago

Hello there. Is there a way to specify hash size of css modules? Classnames seem unnecessary long right now.

bafxyz commented 6 years ago

Want this one as well

billcreative commented 6 years ago

👍 I agree too

artembatura commented 6 years ago

@5angel @bafxyz @billcreative I created repository based on this, but with fresh source from origin create-react-app and short css classnames. Supports now only CSS Modules, SASS & SASS Modules. Create issue, if you need other features https://github.com/artemirq/advanced-react-scripts

Ric-Lavers commented 6 years ago

You should be able to select select the length of the hash changing the REACT_APP_CSS_MODULE_CLASSNAME_TEMPLATE in the .env file as such [sha512:hash:base32:<length>]

for example [sha512:hash:base32:5] will encode using sha512 encoding in base 32 with 5 characters. . . also ensure that this line isn't commented out and that you reset your server when making changes.