fix: order of chunks ids in generated chunk code

This commit is contained in:
Alexander Akait 2024-10-23 17:05:57 +03:00 committed by GitHub
commit 152cb00181
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,8 @@
"use strict";
const { compareIds } = require("../util/comparators");
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Chunk").ChunkId} ChunkId */
/** @typedef {import("../Compiler")} Compiler */
@ -112,8 +114,12 @@ class FlagIncludedChunksPlugin {
for (const m of chunkGraph.getChunkModulesIterable(chunkA)) {
if (!chunkGraph.isModuleInChunk(m, chunkB)) continue loopB;
}
/** @type {ChunkId[]} */
(chunkB.ids).push(/** @type {ChunkId} */ (chunkA.id));
// https://github.com/webpack/webpack/issues/18837
/** @type {ChunkId[]} */
(chunkB.ids).sort(compareIds);
}
}
}