Skip to content

Commit 7097a1d

Browse files
committed
make extracting Sass/LESS more clear
1 parent 91befda commit 7097a1d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,36 @@ module.exports = {
125125
};
126126
```
127127

128+
### Extracting Sass or LESS
129+
130+
The configuration is the same, switch out `sass-loader` for `less-loader` when necessary.
131+
132+
```js
133+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
134+
135+
module.exports = {
136+
module: {
137+
use: [
138+
{
139+
test: /\.scss$/,
140+
use: ExtractTextPlugin.extract({
141+
fallback: 'style-loader',
142+
//resolve-url-loader may be chained before sass-loader if necessary
143+
use: ['css-loader', 'sass-loader']
144+
})
145+
}
146+
]
147+
},
148+
plugins: [
149+
new ExtractTextPlugin('style'css)
150+
//if you want to pass in options, you can do so:
151+
//new ExtractTextPlugin({
152+
// filename: 'style.css'
153+
//})
154+
]
155+
}
156+
```
157+
128158
<h2 align="center">Maintainer</h2>
129159

130160
<table>

0 commit comments

Comments
 (0)