Skip to content

Commit 7ea91fc

Browse files
author
zengjingyi
committed
fix css files load order mismatch webpack-contrib#188
1 parent 30b89d0 commit 7ea91fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,14 @@ class MiniCssExtractPlugin {
390390
const [chunkGroup] = chunk.groupsIterable;
391391
if (typeof chunkGroup.getModuleIndex2 === 'function') {
392392
modules.sort(
393-
(a, b) => chunkGroup.getModuleIndex2(a) - chunkGroup.getModuleIndex2(b)
393+
(a, b) => chunkGroup.getModuleIndex2(b) - chunkGroup.getModuleIndex2(a)
394394
);
395395
} else {
396396
// fallback for older webpack versions
397397
// (to avoid a breaking change)
398398
// TODO remove this in next mayor version
399399
// and increase minimum webpack version to 4.12.0
400-
modules.sort((a, b) => a.index2 - b.index2);
400+
modules.sort((a, b) => b.index2 - a.index2);
401401
}
402402
const source = new ConcatSource();
403403
const externalsSource = new ConcatSource();

0 commit comments

Comments
 (0)