Skip to content

Commit d279b25

Browse files
authored
Merge pull request #391 from bebraw/ignore-fix
Fix ignoreOrder test + add docs
2 parents 10781f5 + 6423619 commit d279b25

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ new ExtractTextPlugin(options: filename | object)
6868
|**`filename`**|`{String}`|Name of the result file. May contain `[name]`, `[id]` and `[contenthash]`|
6969
|**`options.allChunks`**|`{Boolean}`|Extract from all additional chunks too (by default it extracts only from the initial chunk(s))|
7070
|**`options.disable`**|`{Boolean}`|Disables the plugin|
71+
|**`options.ignoreOrder`**|`{Boolean}`|Disables order check (useful for CSS Modules!), `false` by default|
7172

7273
* `[name]` name of the chunk
7374
* `[id]` number of the chunk

schema/plugin-schema.json

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"description": "The filename and path that ExtractTextPlugin will extract to",
2424
"type": "string"
2525
},
26+
"ignoreOrder": {
27+
"description": "Ignore dependency order (useful for CSS Modules)",
28+
"type": "boolean"
29+
},
2630
"loader": {
2731
"description": "The loader that ExtractTextPlugin will attempt to load through.",
2832
"modes": {
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
var ExtractTextPlugin = require("../../../");
22
module.exports = {
3-
entry: "./index.js",
4-
module: {
5-
loaders: [{
6-
test: /\.css$/,
7-
loader: ExtractTextPlugin.extract('style', 'css?modules')
8-
}]
9-
},
10-
plugins: [
11-
new ExtractTextPlugin('file.css', {
12-
ignoreOrder: true
13-
})
14-
]
3+
entry: "./index.js",
4+
module: {
5+
loaders: [
6+
{
7+
test: /\.css$/,
8+
use: ExtractTextPlugin.extract({
9+
fallback: 'style-loader',
10+
use: {
11+
loader: 'css-loader',
12+
options: {
13+
modules: true
14+
}
15+
}
16+
})
17+
}
18+
]
19+
},
20+
plugins: [
21+
new ExtractTextPlugin({
22+
filename: 'file.css',
23+
ignoreOrder: true
24+
})
25+
]
1526
}

0 commit comments

Comments
 (0)