custom-react-scripts icon indicating copy to clipboard operation
custom-react-scripts copied to clipboard

css module hash size?

Open 5angel opened this issue 7 years ago • 4 comments

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

5angel avatar Nov 12 '17 19:11 5angel

Want this one as well

bafxyz avatar Nov 15 '17 22:11 bafxyz

👍 I agree too

billcreative avatar Nov 19 '17 15:11 billcreative

@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

artembatura avatar Jan 15 '18 09:01 artembatura

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.

Ric-Lavers avatar Apr 08 '18 23:04 Ric-Lavers