MCPcopy
hub / github.com/webpack/webpack / addChunk

Method addChunk

lib/Compilation.js:4470–4486  ·  view source on GitHub ↗

* This method first looks to see if a name is provided for a new chunk, * and first looks to see if any named chunks already exist and reuse that chunk instead. * @param {ChunkName=} name optional chunk name to be provided * @returns {Chunk} create a chunk (invoked during seal event)

(name)

Source from the content-addressed store, hash-verified

4468 * @returns {Chunk} create a chunk (invoked during seal event)
4469 */
4470 addChunk(name) {
4471 if (name) {
4472 const chunk = this.namedChunks.get(name);
4473 if (chunk !== undefined) {
4474 return chunk;
4475 }
4476 }
4477 const chunk = new Chunk(name, this._backCompat);
4478 this.chunks.add(chunk);
4479 if (this._backCompat) {
4480 ChunkGraph.setChunkGraphForChunk(chunk, this.chunkGraph);
4481 }
4482 if (name) {
4483 this.namedChunks.set(name, chunk);
4484 }
4485 return chunk;
4486 }
4487
4488 /**
4489 * Processes the provided module.

Callers 3

sealMethod · 0.95
addChunkInGroupMethod · 0.95
addAsyncEntrypointMethod · 0.95

Calls 4

setChunkGraphForChunkMethod · 0.80
getMethod · 0.45
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected