diff --git a/.babelrc b/.babelrc index 11e1c3be..52db72d8 100644 --- a/.babelrc +++ b/.babelrc @@ -27,9 +27,10 @@ "presets": [ "env" ], + "sourceMap" : "inline", "plugins": [ "transform-object-rest-spread" ] } } -} \ No newline at end of file +} diff --git a/src/index.js b/src/index.js index 2bc8b28d..57dc84ff 100644 --- a/src/index.js +++ b/src/index.js @@ -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)) { @@ -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())); diff --git a/test/__snapshots__/webpack-integration.test.js.snap b/test/__snapshots__/webpack-integration.test.js.snap index 05b25321..d5b5a1b7 100644 --- a/test/__snapshots__/webpack-integration.test.js.snap +++ b/test/__snapshots__/webpack-integration.test.js.snap @@ -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; } " `; diff --git a/test/cases/chunk-modules-css-wrong-order/expected/file.css b/test/cases/chunk-modules-css-wrong-order/expected/file.css index 83b0a191..e4ea19ae 100644 --- a/test/cases/chunk-modules-css-wrong-order/expected/file.css +++ b/test/cases/chunk-modules-css-wrong-order/expected/file.css @@ -4,4 +4,3 @@ .App { text-align: center; } -