gajus / gajus/babel-plugin-react-css-modules
Document how to use with create-react-app
- Lingua principale
- JavaScript
- Stelle
- 2k
- Fork
- 159
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
tl;dr;
Use https://github.com/sharegate/craco.
Create `craco.config.js`:
```js
const CSS_MODULE_LOCAL_IDENT_NAME = '[local]___[hash:base64:5]';
module.exports = {
style: {
modules: {
camelCase: true,
localIdentName: CSS_MODULE_LOCAL_IDENT_NAME
}
},
babel: {
loaderOptions: {
// Without this Babel caches module name resolution,
// e.g. wrongly identifies that CSS module does not exist.
cacheDirectory: false,
},
plugins: [
[
'babel-plugin-react-css-modules',
{
attributeNames: {
activeStyleName: 'activeClassName'
},
filetypes: {
'.scss': {
syntax: 'postcss-scss'
}
},
generateScopedName: CSS_MODULE_LOCAL_IDENT_NAME,
handleMissingStyleName: 'warn'
}
]
]
}
};
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.