You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`generateScopedName`|Refer to [Generating scoped names](https://github.com/css-modules/postcss-modules#generating-scoped-names)|`[path]___[name]__[local]___[hash:base64:5]`|
172
172
|`context`|Must match webpack [`context`](https://webpack.github.io/docs/configuration.html#context) configuration. [`css-loader`](https://github.com/webpack/css-loader) inherits `context` values from webpack. Other CSS module implementations might use different context resolution logic.|`process.cwd()`|
173
+
|`filetypes`|Configure [postcss syntax loaders](https://github.com/postcss/postcss#syntaxes) like sugerss, LESS and SCSS. ||
174
+
|`generateScopedName`|Refer to [Generating scoped names](https://github.com/css-modules/postcss-modules#generating-scoped-names)|`[path]___[name]__[local]___[hash:base64:5]`|
173
175
174
176
Missing a configuration? [Raise an issue](https://github.com/gajus/babel-plugin-react-css-modules/issues/new?title=New%20configuration:).
175
177
176
178
> Note:
177
179
> The default configuration should work out of the box with the [css-loader](https://github.com/webpack/css-loader).
178
180
181
+
### Configurate syntax loaders
182
+
183
+
To add support for different CSS syntaxes (e.g. SCSS), perform the following two steps:
184
+
185
+
1. Add the [postcss syntax loader](https://github.com/postcss/postcss#syntaxes) as a development dependency:
186
+
187
+
```bash
188
+
npm install postcss-scss --save-dev
189
+
```
190
+
191
+
2. Add a filetype syntax mapping to the Babel plugin configuration
192
+
193
+
```json
194
+
"filetypes": {
195
+
".scss": "postcss-scss"
196
+
}
197
+
```
198
+
179
199
## Installation
180
200
181
201
When `babel-plugin-react-css-modules` cannot resolve CSS module at a compile time, it imports a helper function (read [Runtime `styleName` resolution](#runtime-stylename-resolution)). Therefore, you must install `babel-plugin-react-css-modules` as a direct dependency of the project.
0 commit comments