Skip to content

Commit 659a534

Browse files
committed
Merge pull request gajus#72 from tiemevanveen/patch-2
Added sourcemaps documentation
2 parents 0a622ea + 170a783 commit 659a534

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
@@ -23,6 +23,8 @@ React CSS Modules implement automatic mapping of CSS modules. Every CSS class is
2323
- [Options](#options)
2424
- [`allowMultiple`](#allowmultiple)
2525
- [`errorWhenNotFound`](#errorwhennotfound)
26+
- [SASS, SCSS, LESS and other CSS Preprocessors](#sass-scss-less-and-other-css-preprocessors)
27+
- [Enable Sourcemaps](#enable-sourcemaps)
2628
- [React Hot Module Replacement](#react-hot-module-replacement)
2729
- [Class Composition](#class-composition)
2830
- [What Problems does Class Composition Solve?](#what-problems-does-class-composition-solve)
@@ -423,6 +425,17 @@ Throws an error when `styleName` cannot be mapped to an existing CSS Module.
423425
}
424426
```
425427

428+
### Enable Sourcemaps
429+
430+
To enable CSS Source maps, you'll need to pass the sourceMap-option to the css-loader:
431+
432+
```js
433+
{
434+
test: /\.scss$/,
435+
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass')
436+
}
437+
```
438+
426439
## React Hot Module Replacement
427440

428441
[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)