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

Commit

Permalink
test: Failing test for css ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwiens committed Jul 7, 2017
1 parent 28363ab commit 55f2cf0
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -144,7 +144,7 @@ class ExtractTextPlugin {
async.forEach(chunks, (chunk, callback) => { // eslint-disable-line no-shadow
const extractedChunk = extractedChunks[chunks.indexOf(chunk)];
const shouldExtract = !!(options.allChunks || isInitialOrHasNoParents(chunk));
chunk.sortModules();
chunk.sortModules(module);
async.forEach(chunk.mapModules(c => c), (module, callback) => { // eslint-disable-line no-shadow
let meta = module[NS];
if (meta && (!meta.options.id || meta.options.id === id)) {
Expand Down
10 changes: 10 additions & 0 deletions test/__snapshots__/webpack-integration.test.js.snap
@@ -1,5 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Webpack Integration Tests chunk-modules-css-wrong-order 1`] = `
".block {
color: tomato;
}
.App {
color: black;
}
"
`;

exports[`Webpack Integration Tests chunk-modules-nested-ordered-by-id 1`] = `
"body {
margin: 0;
Expand Down
3 changes: 3 additions & 0 deletions test/cases/chunk-modules-css-wrong-order/a.css
@@ -0,0 +1,3 @@
.App {
text-align: center;
}
2 changes: 2 additions & 0 deletions test/cases/chunk-modules-css-wrong-order/a.js
@@ -0,0 +1,2 @@
require('./b.js');
require('./a.css');
3 changes: 3 additions & 0 deletions test/cases/chunk-modules-css-wrong-order/b.css
@@ -0,0 +1,3 @@
.block {
font-size: 16px;
}
1 change: 1 addition & 0 deletions test/cases/chunk-modules-css-wrong-order/b.js
@@ -0,0 +1 @@
require('./b.css');
7 changes: 7 additions & 0 deletions test/cases/chunk-modules-css-wrong-order/expected/file.css
@@ -0,0 +1,7 @@
.block {
font-size: 16px;
}
.App {
text-align: center;
}

1 change: 1 addition & 0 deletions test/cases/chunk-modules-css-wrong-order/index.js
@@ -0,0 +1 @@
require('./a.js');
19 changes: 19 additions & 0 deletions test/cases/chunk-modules-css-wrong-order/webpack.config.js
@@ -0,0 +1,19 @@
import ExtractTextPlugin from '../../../src/index';

module.exports = {
entry: './index',
module: {
loaders: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: { loader: 'style-loader' },
use: { loader: 'css-loader', },
})
},
],
},
plugins: [
new ExtractTextPlugin('file.css'),
],
};

0 comments on commit 55f2cf0

Please sign in to comment.