-
-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Labels
Description
See also #580.
I messed up when checking dependency updates today, and upgrading from css-loader v3.6.0 to v4.2.0 totally hosed the layout. The core problem is that in v4, css-loader and babel-plugin-react-css-modules generate different hashes for identifiers. Specifically:
-
They depend on different versions of
loader-utils
, and the default hash type changed from md5 to md4. We can work around this by explicitly specifying the hash type on our identifier template:Current: "[path]___[name]__[local]___[hash:base64:5]" Workaround: "[path]___[name]__[local]___[md5:hash:base64:5]"
-
They compose the core value of the hash in fundamentally different ways. The changes in question happened here: webpack-contrib/css-loader@d2f6bd2
Working around this would require either:
- Not using a hash in the identifier name (at least, although that still puts us on tenuous ground for other kinds of future changes).
- Specifying a function for both babel-plugin-react-css-modules and css-loader instead of strings. This should be possible, but there’s an open issue about it not working right on babel-plugin-react-css-modules. Not sure whether that’s accurate or not.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done