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

Commit

Permalink
fix: CSS rendering order
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwiens committed Jul 7, 2017
1 parent 55f2cf0 commit 5813cc7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Expand Up @@ -27,9 +27,10 @@
"presets": [
"env"
],
"sourceMap" : "inline",
"plugins": [
"transform-object-rest-spread"
]
}
}
}
}
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -144,7 +144,6 @@ 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(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 Expand Up @@ -194,7 +193,8 @@ class ExtractTextPlugin {
compilation.plugin('additional-assets', (callback) => {
extractedChunks.forEach((extractedChunk) => {
if (extractedChunk.getNumberOfModules()) {
extractedChunk.modules.sort((a, b) => {
extractedChunk.sortModules((a, b) => {
// extractedChunk.modules.sort((a, b) => {
if (!options.ignoreOrder && isInvalidOrder(a, b)) {
compilation.errors.push(new OrderUndefinedError(a.getOriginalModule()));
compilation.errors.push(new OrderUndefinedError(b.getOriginalModule()));
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/webpack-integration.test.js.snap
Expand Up @@ -2,10 +2,10 @@

exports[`Webpack Integration Tests chunk-modules-css-wrong-order 1`] = `
".block {
color: tomato;
font-size: 16px;
}
.App {
color: black;
text-align: center;
}
"
`;
Expand Down
1 change: 0 additions & 1 deletion test/cases/chunk-modules-css-wrong-order/expected/file.css
Expand Up @@ -4,4 +4,3 @@
.App {
text-align: center;
}

0 comments on commit 5813cc7

Please sign in to comment.