MCPcopy
hub / github.com/webpack/webpack / getChunkInfo

Function getChunkInfo

lib/javascript/ChunkFormatHelpers.js:23–37  ·  view source on GitHub ↗

* Returns } Object containing chunk entries and runtime chunk. * @param {Chunk} chunk The chunk to get information for * @param {ChunkGraph} chunkGraph The chunk graph containing the chunk * @returns {{ entries: [Module, Entrypoint | undefined][], runtimeChunk: Chunk | null }} Object containing c

(chunk, chunkGraph)

Source from the content-addressed store, hash-verified

21 * @returns {{ entries: [Module, Entrypoint | undefined][], runtimeChunk: Chunk | null }} Object containing chunk entries and runtime chunk
22 */
23function getChunkInfo(chunk, chunkGraph) {
24 const entries = [
25 ...chunkGraph.getChunkEntryModulesWithChunkGroupIterable(chunk)
26 ];
27 const runtimeChunk =
28 entries.length > 0
29 ? /** @type {Entrypoint[][]} */
30 (entries)[0][1].getRuntimeChunk()
31 : null;
32
33 return {
34 entries,
35 runtimeChunk
36 };
37}
38
39/**
40 * Creates a chunk hash handler

Callers 3

applyMethod · 0.85
createChunkHashHandlerFunction · 0.85
applyMethod · 0.85

Tested by

no test coverage detected