MCPcopy
hub / github.com/webpack/webpack / addChunkRuntimeRequirements

Method addChunkRuntimeRequirements

lib/ChunkGraph.js:1709–1720  ·  view source on GitHub ↗

* Adds chunk runtime requirements. * @param {Chunk} chunk the chunk * @param {RuntimeRequirements} items runtime requirements to be added (ownership of this Set is given to ChunkGraph) * @returns {void}

(chunk, items)

Source from the content-addressed store, hash-verified

1707 * @returns {void}
1708 */
1709 addChunkRuntimeRequirements(chunk, items) {
1710 const cgc = this._getChunkGraphChunk(chunk);
1711 const runtimeRequirements = cgc.runtimeRequirements;
1712 if (runtimeRequirements === undefined) {
1713 cgc.runtimeRequirements = items;
1714 } else if (runtimeRequirements.size >= items.size) {
1715 for (const item of items) runtimeRequirements.add(item);
1716 } else {
1717 for (const item of runtimeRequirements) items.add(item);
1718 cgc.runtimeRequirements = items;
1719 }
1720 }
1721
1722 /**
1723 * Adds tree runtime requirements.

Callers 1

Calls 2

_getChunkGraphChunkMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected