(chunks, compilation)
| 477 | * @returns {void} |
| 478 | */ |
| 479 | const assignAscendingChunkIds = (chunks, compilation) => { |
| 480 | const usedIds = getUsedChunkIds(compilation); |
| 481 | |
| 482 | let nextId = 0; |
| 483 | if (usedIds.size > 0) { |
| 484 | for (const chunk of chunks) { |
| 485 | if (chunk.id === null) { |
| 486 | while (usedIds.has(String(nextId))) nextId++; |
| 487 | chunk.id = nextId; |
| 488 | chunk.ids = [nextId]; |
| 489 | nextId++; |
| 490 | } |
| 491 | } |
| 492 | } else { |
| 493 | for (const chunk of chunks) { |
| 494 | if (chunk.id === null) { |
| 495 | chunk.id = nextId; |
| 496 | chunk.ids = [nextId]; |
| 497 | nextId++; |
| 498 | } |
| 499 | } |
| 500 | } |
| 501 | }; |
| 502 | |
| 503 | module.exports.assignAscendingChunkIds = assignAscendingChunkIds; |
| 504 | module.exports.assignAscendingModuleIds = assignAscendingModuleIds; |
no test coverage detected