gajus / gajus/babel-plugin-react-css-modules

README lacks config documentation

Open
#75 2 comments 9 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2k
Forks
159
PR merge metrics
No merged PRs in 30d

Description

Hi, I can't add a StackOverflow question because the tag is too long.
![image](https://cloud.githubusercontent.com/assets/1034890/25085307/c8bfeee6-23a4-11e7-830c-f6b31912ed6d.png)

I'm having problems configuring babel-plugin-react-css-modules with Webpack v2.5 There doesn't seem to be any documentation on how to set it up and the demo given doesn't work with webpack 2.5 (can't provide query inside loaders anymore).

Here's what I have right now in my webpack config:
```
{
test: /\.s?css$/,
loaders: [
'style-loader?sourceMap',
'css-loader?modules&importLoaders=1&localIdentName=' +
'[path]___[name]__[local]___[hash:base64:5]'
]
},
```
And in my .babelrc I have:
```
"plugins": [
"react-css-modules"
],
```
(If I leave the babelrc reference out, I don't get any classes added)

The issue I'm facing is that the classes in the stylesheet don't match the classes applied to the element. Presumably because the context is not correct. But I don't know how to specify the context within webpack config.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.