Skip to content

Commit 10781f5

Browse files
authored
Merge pull request faceyspacey#166 from MicheleBertoli/order-undefined-error
Add ignoreOrder option to avoid the OrderUndefinedError
2 parents 313a08a + 614c3bb commit 10781f5

File tree

8 files changed

+38
-1
lines changed

8 files changed

+38
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
309309
extractedChunks.forEach(function(extractedChunk) {
310310
if(extractedChunk.modules.length) {
311311
extractedChunk.modules.sort(function(a, b) {
312-
if(isInvalidOrder(a, b)) {
312+
if(!options.ignoreOrder && isInvalidOrder(a, b)) {
313313
compilation.errors.push(new OrderUndefinedError(a.getOriginalModule()));
314314
compilation.errors.push(new OrderUndefinedError(b.getOriginalModule()));
315315
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.a {
2+
composes: c1 from './c1.css';
3+
composes: c2 from './c2.css';
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.b {
2+
composes: c2 from './c2.css';
3+
composes: c1 from './c1.css';
4+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.c1 {
2+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.c2 {
2+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
._3QiTkN7JPds2C9Bq73MpOX {
2+
}
3+
._3dtwYD12yqGZUJ-uPQLu9z {
4+
}
5+
._32HVXkGocfWZMaHoXEFkED {
6+
}
7+
.hbZI7DlQBB9VYNCgL20kL {
8+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require('./a.css');
2+
require('./b.css');
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var ExtractTextPlugin = require("../../../");
2+
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+
]
15+
}

0 commit comments

Comments
 (0)