Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme.md #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ var generate = genericNames('[name]__[local]___[hash:base64:5]', {

generate('foo', '/case/source.css'); // 'source__foo___3mRq8'
```

## Compatibility

### With Webpack's `css-loader` and `babel-plugin-react-css-modules`

Starting from version `3.0`, this plugin is not compatible with `babel-plugin-react-css-modules` running under `css-modules<3.6.0` due to [this update](https://github.com/webpack-contrib/css-loader/commit/d2f6bd2755a513e98faca84c3f52544be72d53f3).

Explanation: starting from `3.6.0`, css-modules uses `\x00` instead of `+` when generating `content.options` consumed by Webpack when generating `[hash]` and `[contenthash]`, as can be seen in [this update](https://github.com/webpack-contrib/css-loader/commit/d2f6bd2755a513e98faca84c3f52544be72d53f3#diff-3274f1a37032fb0ae4e2823def0007c634e869ae0dfc304ff6a12c36513c3a52R49). As a result, the hash value generated by the react css modules plugin is not the same as the one generated by Webpack's css-loader.