babel-plugin-react-css-modules
babel-plugin-react-css-modules copied to clipboard
The official demo has important bug
A few days ago,I submitted an issue,#238
"All styles are automatically converted to hash names(This should not be like this),when i use 'styleName' on tag,This can be converted to hash names,But they are not match"
I find that offical demo has the same problem,just like above description

i have same problem. it seem cause by window. you can upgrade css-loader v2 . then, it is ok!
package.json

webpack.config.js
/* eslint-disable filenames/match-regex, import/no-commonjs */
const path = require("path");
const context = path.resolve(__dirname, "src");
module.exports = {
context,
entry: "./index.js",
module: {
loaders: [
{
include: path.resolve(__dirname, "./src"),
loaders: [
"style-loader",
{
loader: "css-loader",
options: {
importLoaders: 1,
modules: true,
localIdentName: '[path]___[name]__[local]___[hash:base64:5]',
context
}
}
],
test: /\.css$/
},
{
include: path.resolve(__dirname, "./src"),
loader: "babel-loader",
query: {
plugins: [
"@babel/transform-react-jsx",
[
"react-css-modules",
{
context
}
]
]
},
test: /\.js$/
}
]
},
output: {
filename: "[name].js"
},
stats: "minimal"
};