fix: adjust the timing for adding Group when depending on runtimeChunk

This commit is contained in:
Xiao 2025-08-11 23:10:06 +08:00 committed by GitHub
parent e3c48f5df4
commit cbacdf11bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 16 deletions

View File

@ -3261,6 +3261,23 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
}
}
buildChunkGraph(this, chunkGraphInit);
this.hooks.afterChunks.call(this.chunks);
this.logger.timeEnd("create chunks");
this.logger.time("optimize");
this.hooks.optimize.call();
while (this.hooks.optimizeModules.call(this.modules)) {
/* empty */
}
this.hooks.afterOptimizeModules.call(this.modules);
while (this.hooks.optimizeChunks.call(this.chunks, this.chunkGroups)) {
/* empty */
}
this.hooks.afterOptimizeChunks.call(this.chunks, this.chunkGroups);
for (const [
name,
{
@ -3280,22 +3297,6 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
}
}
}
buildChunkGraph(this, chunkGraphInit);
this.hooks.afterChunks.call(this.chunks);
this.logger.timeEnd("create chunks");
this.logger.time("optimize");
this.hooks.optimize.call();
while (this.hooks.optimizeModules.call(this.modules)) {
/* empty */
}
this.hooks.afterOptimizeModules.call(this.modules);
while (this.hooks.optimizeChunks.call(this.chunks, this.chunkGroups)) {
/* empty */
}
this.hooks.afterOptimizeChunks.call(this.chunks, this.chunkGroups);
this.hooks.optimizeTree.callAsync(this.chunks, this.modules, (err) => {
if (err) {