Skip to content

Commit d994af7

Browse files
committed
Add example for multiple plugin instances
1 parent d34d0fb commit d994af7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,29 @@ Creates an extracting loader from an existing loader.
6464

6565
There is also an `extract` function on the instance. You should use this if you have more than one ExtractTextPlugin.
6666

67+
```javascript
68+
let ExtractTextPlugin = require('extract-text-webpack-plugin');
69+
70+
// multiple extract instances
71+
let extractCSS = new ExtractTextPlugin('stylesheets/[name].css');
72+
let extractLESS = new ExtractTextPlugin('stylesheets/[name].less');
73+
74+
module.exports = {
75+
...
76+
module: {
77+
loaders: [
78+
{test: /\.scss$/i, loader: extractCSS.extract(['css','sass'])},
79+
{test: /\.less$/i, loader: extractLESS.extract(['css','less'])},
80+
...
81+
]
82+
},
83+
plugins: [
84+
extractCSS,
85+
extractLESS
86+
]
87+
};
88+
```
89+
6790
## License
6891

6992
MIT (http://www.opensource.org/licenses/mit-license.php)

0 commit comments

Comments
 (0)