* Gets chunk module maps. * @deprecated * @param {ModuleFilterPredicate} filterFn function used to filter modules * @returns {ChunkModuleMaps} module map information
(filterFn)
| 409 | * @returns {ChunkModuleMaps} module map information |
| 410 | */ |
| 411 | getChunkModuleMaps(filterFn) { |
| 412 | const chunkGraph = ChunkGraph.getChunkGraphForChunk( |
| 413 | this, |
| 414 | "Chunk.getChunkModuleMaps", |
| 415 | "DEP_WEBPACK_CHUNK_GET_CHUNK_MODULE_MAPS" |
| 416 | ); |
| 417 | /** @type {ChunkModuleIdMap} */ |
| 418 | const chunkModuleIdMap = Object.create(null); |
| 419 | /** @type {chunkModuleHashMap} */ |
| 420 | const chunkModuleHashMap = Object.create(null); |
| 421 | |
| 422 | for (const asyncChunk of this.getAllAsyncChunks()) { |
| 423 | /** @type {ChunkId[] | undefined} */ |
| 424 | let array; |
| 425 | for (const module of chunkGraph.getOrderedChunkModulesIterable( |
| 426 | asyncChunk, |
| 427 | compareModulesById(chunkGraph) |
| 428 | )) { |
| 429 | if (filterFn(module)) { |
| 430 | if (array === undefined) { |
| 431 | array = []; |
| 432 | chunkModuleIdMap[/** @type {ChunkId} */ (asyncChunk.id)] = array; |
| 433 | } |
| 434 | const moduleId = |
| 435 | /** @type {ModuleId} */ |
| 436 | (chunkGraph.getModuleId(module)); |
| 437 | array.push(moduleId); |
| 438 | chunkModuleHashMap[moduleId] = chunkGraph.getRenderedModuleHash( |
| 439 | module, |
| 440 | undefined |
| 441 | ); |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | return { |
| 447 | id: chunkModuleIdMap, |
| 448 | hash: chunkModuleHashMap |
| 449 | }; |
| 450 | } |
| 451 | |
| 452 | /** |
| 453 | * Checks whether this chunk contains a matching module in the graph. |
no test coverage detected