Skip to content

Commit 170a783

Browse files
committed
Sourcemaps documentation
1 parent abfc2e3 commit 170a783

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ React CSS Modules implement automatic mapping of CSS modules. Every CSS class is
2121
- [Options](#options)
2222
- [`allowMultiple`](#allowmultiple)
2323
- [`errorWhenNotFound`](#errorwhennotfound)
24+
- [SASS, SCSS, LESS and other CSS Preprocessors](#sass-scss-less-and-other-css-preprocessors)
25+
- [Enable Sourcemaps](#enable-sourcemaps)
2426
- [React Hot Module Replacement](#react-hot-module-replacement)
2527
- [Class Composition](#class-composition)
2628
- [What Problems does Class Composition Solve?](#what-problems-does-class-composition-solve)
@@ -367,6 +369,17 @@ Throws an error when `styleName` cannot be mapped to an existing CSS Module.
367369
}
368370
```
369371

372+
### Enable Sourcemaps
373+
374+
To enable CSS Source maps, you'll need to pass the sourceMap-option to the css-loader:
375+
376+
```js
377+
{
378+
test: /\.scss$/,
379+
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass')
380+
}
381+
```
382+
370383
## React Hot Module Replacement
371384

372385
[Hot module reloading](https://github.com/gaearon/react-transform-hmr) (HMR) does not reload the CSS document (see https://github.com/gajus/react-css-modules/issues/51). It only reloads the `class` HTML attribute value.

0 commit comments

Comments
 (0)