Closed XOneto9 closed 5 years ago
@XOneto9 I think one workaround is to change the webpack config from the ejected app
{
test: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
modules: true,
- getLocalIdent: getCSSModuleLocalIdent,
+ localIdentName: '[name]__[local]___[hash:base64:5]',
}),
},
@AlbertLucianto Hi, Thanks to reply. yes, nothing to way to resolve this problem is your solutions.
thanks.
Hello,
I've tried the above craco configuration together with the default babel-plugin-react-css-modules installation npm install babel-plugin-react-css-modules --save
but importing with import styles from './styles.css'
and referencing to it with styleName='my-style'
doesn't work for me.
Am I missing something?
hi, a few days ago, I post some question about that how to it work because of getting error. So, I try to some attempt about to work, but the problem is that if I set the context, configuration of Webpack and etc... the create-react-app v2 has changed to making hashed style name.
In create-react-app v2, the style module format is add "module" character like as
but this babel-plugin-react-css-modules of hashed name in the babelrc is like as
"generateScopedName": "[name]_[local]__[hash:base64:5]",
so, the results of product class name is like thatincluding "App-module" as [name] .
so I don't know how to use in the create-react-app v2 if I exclude character of name "module" in the scss name, then the create-react-app has not recognized. how can I do that...??