MCPcopy
hub / github.com/webpack/webpack / updateFileWithReplacementSource

Method updateFileWithReplacementSource

lib/Compiler.js:958–972  ·  lib/Compiler.js::Compiler.updateFileWithReplacementSource
(
							file,
							cacheEntry,
							size
						)

Source from the content-addressed store, hash-verified

956 * @param {number} size size
957 */
958 const updateFileWithReplacementSource = (
959 file,
960 cacheEntry,
961 size
962 ) => {
963 class="cm">// Create a replacement resource which only allows to ask for size
964 class="cm">// This allows to GC all memory allocated by the Source
965 class="cm">// (expect when the Source is stored in any other cache)
966 if (!cacheEntry.sizeOnlySource) {
967 cacheEntry.sizeOnlySource = new SizeOnlySource(size);
968 }
969 compilation.updateAsset(file, cacheEntry.sizeOnlySource, {
970 size
971 });
972 };
973
974 /**
975 * Process existing file.

Callers

nothing calls this directly

Calls 1

updateAssetMethod · 0.80

Tested by

no test coverage detected