ro-savage / react-scripts-cssmodules

Enable CSS Modules for Create-React-App using the official CRA api
https://www.npmjs.com/package/react-scripts-cssmodules
47 stars 5 forks source link

Shorter class names #4

Closed Tam closed 6 years ago

Tam commented 6 years ago

Is there a way I can configure the class name generation?

Currently the class names are ridiculously long (src-_components-Button-__Button-module___button src-_components-Button-__Button-module___primary src-_components-Button-__Button-module___large). Would it be possible to configure them to make them shorter (i.e. [local]-[hash:base64:5] to produce button-xkpkl)?

ro-savage commented 6 years ago

It wouldn't be hard to do as part of package.json, however because CRA avoids configuration, I wouldn't want to add it unless the CRA mainters agreed it was a good idea.

I am currently looking into some other naming options, which would make it much shorter in the next release.