MCPcopy
hub / github.com/webpack/webpack / getChunkEntryDependentChunksIterable

Method getChunkEntryDependentChunksIterable

lib/ChunkGraph.js:1327–1345  ·  view source on GitHub ↗

* Gets chunk entry dependent chunks iterable. * @param {Chunk} chunk the chunk * @returns {Iterable<Chunk>} iterable of chunks

(chunk)

Source from the content-addressed store, hash-verified

1325 * @returns {Iterable<Chunk>} iterable of chunks
1326 */
1327 getChunkEntryDependentChunksIterable(chunk) {
1328 /** @type {Chunks} */
1329 const set = new Set();
1330 for (const chunkGroup of chunk.groupsIterable) {
1331 if (chunkGroup instanceof Entrypoint) {
1332 const entrypointChunk = chunkGroup.getEntrypointChunk();
1333 const cgc = this._getChunkGraphChunk(entrypointChunk);
1334 for (const chunkGroup of cgc.entryModules.values()) {
1335 for (const c of chunkGroup.chunks) {
1336 if (c !== chunk && c !== entrypointChunk && !c.hasRuntime()) {
1337 set.add(c);
1338 }
1339 }
1340 }
1341 }
1342 }
1343
1344 return set;
1345 }
1346
1347 /**
1348 * Gets runtime chunk dependent chunks iterable.

Callers 2

applyMethod · 0.80
generateMethod · 0.80

Calls 5

_getChunkGraphChunkMethod · 0.95
getEntrypointChunkMethod · 0.80
hasRuntimeMethod · 0.80
valuesMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected