gajus / babel-plugin-react-css-modules

Transforms styleName to className using compile time CSS module resolution.
Other
2.05k stars 162 forks source link

What determines the order CSS modules are loaded in? #281

Closed silkfire closed 4 years ago

silkfire commented 4 years ago

I'm having an issue with that the order the CSS modules are loaded isn't consistent; it is slightly different on every build. This affects the resulting hash of the generated files as I'm using a custom generateScopedName function. This is important as the order of which they arrive to the function determines the output class name.

Is there a way to control the loading order used by the loader? Specifically referring to this bullet point:

How does it work?

  1. Builds index of all stylesheet imports per file (imports of files with .css or .scss extension).
gajus commented 4 years ago

This question should be directed at postcss css modules module.