Skip to content

Add info about integration with CSS Modules #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ module.exports = {
[webpack loader-context]: http://webpack.github.io/docs/loaders.html#loader-context
[postcss-import]: https://github.com/postcss/postcss-import

## Integration with CSS Modules

postcss-loader [cannot be used] with [CSS Modules] out of the box due to the way css-loader processes file imports. To make them work property, either add the css-loader’s [`importLoaders` option]:

```js
{
test: /\.css$/,
loader: "style-loader!css-loader?modules&importLoaders=1!postcss-loader"
}
```

or replace css-loader with [postcss-modules] plugin.

[cannot be used]: https://github.com/webpack/css-loader/issues/137
[CSS Modules]: https://github.com/webpack/css-loader#css-modules
[`importLoaders` option]: github.com/webpack/css-loader#importing-and-chained-loaders
[postcss-modules]: https://github.com/outpunk/postcss-modules

## JS Styles

If you want to process styles written in JavaScript
Expand Down