Skip to content

Commit

Permalink
fix css files load order mismatch webpack-contrib#188
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaMaid committed Aug 8, 2018
1 parent 30b89d0 commit 856da5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,14 @@ class MiniCssExtractPlugin {
const [chunkGroup] = chunk.groupsIterable;
if (typeof chunkGroup.getModuleIndex2 === 'function') {
modules.sort(
(a, b) => chunkGroup.getModuleIndex2(a) - chunkGroup.getModuleIndex2(b)
(a, b) => chunkGroup.getModuleIndex2(b) - chunkGroup.getModuleIndex2(a)
);
} else {
// fallback for older webpack versions
// (to avoid a breaking change)
// TODO remove this in next mayor version
// and increase minimum webpack version to 4.12.0
modules.sort((a, b) => a.index2 - b.index2);
modules.sort((a, b) => b.index2 - a.index2);
}
const source = new ConcatSource();
const externalsSource = new ConcatSource();
Expand Down

0 comments on commit 856da5e

Please sign in to comment.