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

Commit 55f2cf0

Browse files
committed
test: Failing test for css ordering
1 parent 28363ab commit 55f2cf0

File tree

9 files changed

+47
-1
lines changed

9 files changed

+47
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +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();
147+
chunk.sortModules(module);
148148
async.forEach(chunk.mapModules(c => c), (module, callback) => { // eslint-disable-line no-shadow
149149
let meta = module[NS];
150150
if (meta && (!meta.options.id || meta.options.id === id)) {

test/__snapshots__/webpack-integration.test.js.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`Webpack Integration Tests chunk-modules-css-wrong-order 1`] = `
4+
".block {
5+
color: tomato;
6+
}
7+
.App {
8+
color: black;
9+
}
10+
"
11+
`;
12+
313
exports[`Webpack Integration Tests chunk-modules-nested-ordered-by-id 1`] = `
414
"body {
515
margin: 0;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.App {
2+
text-align: center;
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require('./b.js');
2+
require('./a.css');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.block {
2+
font-size: 16px;
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('./b.css');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.block {
2+
font-size: 16px;
3+
}
4+
.App {
5+
text-align: center;
6+
}
7+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('./a.js');
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import ExtractTextPlugin from '../../../src/index';
2+
3+
module.exports = {
4+
entry: './index',
5+
module: {
6+
loaders: [
7+
{
8+
test: /\.css$/,
9+
use: ExtractTextPlugin.extract({
10+
fallback: { loader: 'style-loader' },
11+
use: { loader: 'css-loader', },
12+
})
13+
},
14+
],
15+
},
16+
plugins: [
17+
new ExtractTextPlugin('file.css'),
18+
],
19+
};

0 commit comments

Comments
 (0)