(chunkGraph)
| 532 | * @returns {Comparator<Chunk>} comparator |
| 533 | */ |
| 534 | const compareChunksNatural = (chunkGraph) => { |
| 535 | const cmpFn = module.exports.compareModulesById(chunkGraph); |
| 536 | const cmpIterableFn = compareIterables(cmpFn); |
| 537 | return concatComparators( |
| 538 | compareSelect((chunk) => /** @type {ChunkName} */ (chunk.name), compareIds), |
| 539 | compareSelect((chunk) => chunk.runtime, compareRuntime), |
| 540 | compareSelect( |
| 541 | /** |
| 542 | * Handles the callback logic for this hook. |
| 543 | * @param {Chunk} chunk a chunk |
| 544 | * @returns {Iterable<Module>} modules |
| 545 | */ |
| 546 | (chunk) => chunkGraph.getOrderedChunkModulesIterable(chunk, cmpFn), |
| 547 | cmpIterableFn |
| 548 | ) |
| 549 | ); |
| 550 | }; |
| 551 | |
| 552 | /** |
| 553 | * For HarmonyImportSideEffectDependency and HarmonyImportSpecifierDependency, we should prioritize import order to match the behavior of running modules directly in a JS engine without a bundler. |
no test coverage detected