MCPcopy
hub / github.com/webpack/webpack / _renameAssetInChunk

Method _renameAssetInChunk

lib/Compilation.js:5397–5404  ·  view source on GitHub ↗

* @private * @param {Chunk} chunk the chunk owning the set * @param {Set<string>} set chunk.files or chunk.auxiliaryFiles * @param {Map<string, Set<Chunk>>} index matching reverse index * @param {string} file old file name * @param {string} newFile new file name * @returns {void}

(chunk, set, index, file, newFile)

Source from the content-addressed store, hash-verified

5395 * @returns {void}
5396 */
5397 _renameAssetInChunk(chunk, set, index, file, newFile) {
5398 // Only carry the rename to chunks that actually held the old name.
5399 if (!set.delete(file)) return;
5400 set.add(newFile);
5401 let target = index.get(newFile);
5402 if (target === undefined) index.set(newFile, (target = new Set()));
5403 target.add(chunk);
5404 }
5405
5406 /**
5407 * Processes the provided file.

Callers 1

renameAssetMethod · 0.95

Calls 4

deleteMethod · 0.45
addMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected