Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 5a23fc0

Browse files
hulkishjoshwiens
authored andcommitted
fix: corrected order for chunk.modules (#563)
* corrected order for chunk.modules loop * added regression test for #548 * upgraded to latest webpack version 3.1.0 which includes needed Chunk.sortModules method * applied change to new location of index.js
1 parent 10721f5 commit 5a23fc0

File tree

8 files changed

+24
-1
lines changed

8 files changed

+24
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"node": ">= 4.3 < 5.0.0 || >= 5.10"
6262
},
6363
"peerDependencies": {
64-
"webpack": "^3.0.0"
64+
"webpack": "^3.1.0"
6565
},
6666
"homepage": "http://github.com/webpack-contrib/extract-text-webpack-plugin",
6767
"repository": {

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class ExtractTextPlugin {
144144
async.forEach(chunks, (chunk, callback) => { // eslint-disable-line no-shadow
145145
const extractedChunk = extractedChunks[chunks.indexOf(chunk)];
146146
const shouldExtract = !!(options.allChunks || isInitialOrHasNoParents(chunk));
147+
chunk.sortModules();
147148
async.forEach(chunk.mapModules((c) => { return c; }), (module, callback) => { // eslint-disable-line no-shadow, arrow-body-style
148149
let meta = module[NS];
149150
if (meta && (!meta.options.id || meta.options.id === id)) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('./c.txt');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.block {
2+
color: tomato;
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.App {
2+
color: black;
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.block {
2+
color: tomato;
3+
}
4+
.App {
5+
color: black;
6+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require('./a');
2+
require('./b.txt');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var ExtractTextPlugin = require("../../../");
2+
module.exports = {
3+
entry: "./index",
4+
plugins: [
5+
new ExtractTextPlugin("file.css")
6+
]
7+
};

0 commit comments

Comments
 (0)