Skip to content

Commit c109651

Browse files
authored
Merge pull request #16144 from KurumiRin/main
fix: when the jobs parameter is an empty array, block unnecessary runCodeGenerationJobs
2 parents 636f321 + 946f98e commit c109651

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

lib/Compilation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,6 +3192,9 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
31923192
}
31933193

31943194
_runCodeGenerationJobs(jobs, callback) {
3195+
if (jobs.length === 0) {
3196+
return callback();
3197+
}
31953198
let statModulesFromCache = 0;
31963199
let statModulesGenerated = 0;
31973200
const { chunkGraph, moduleGraph, dependencyTemplates, runtimeTemplate } =

test/__snapshots__/StatsTestCases.basictest.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,6 @@ asset <CLR=32,BOLD>main.js</CLR> 84 bytes <CLR=32,BOLD>[emitted]</CLR> (name: ma
13651365
<CLR=BOLD>LOG from webpack.Compilation</CLR>
13661366
<CLR=BOLD>1 modules hashed, 0 from cache (1 variants per module in average)</CLR>
13671367
<CLR=BOLD>100% code generated (1 generated, 0 from cache)</CLR>
1368-
<CLR=BOLD>NaN% code generated (0 generated, 0 from cache)</CLR>
13691368
+ 24 hidden lines
13701369
13711370
<CLR=BOLD>LOG from webpack.FlagDependencyExportsPlugin</CLR>

0 commit comments

Comments
 (0)