MCPcopy
hub / github.com/webpack/webpack / updateHash

Method updateHash

lib/Chunk.js:634–652  ·  view source on GitHub ↗

* Updates the hash with the data contributed by this instance. * @param {Hash} hash hash (will be modified) * @param {ChunkGraph} chunkGraph the chunk graph * @returns {void}

(hash, chunkGraph)

Source from the content-addressed store, hash-verified

632 * @returns {void}
633 */
634 updateHash(hash, chunkGraph) {
635 hash.update(
636 `${this.id} ${this.ids ? this.ids.join() : ""} ${this.name || ""} `
637 );
638 const xor = new StringXor();
639 for (const m of chunkGraph.getChunkModulesIterable(this)) {
640 xor.add(chunkGraph.getModuleHash(m, this.runtime));
641 }
642 xor.updateHash(hash);
643 const entryModules =
644 chunkGraph.getChunkEntryModulesWithChunkGroupIterable(this);
645 for (const [m, chunkGroup] of entryModules) {
646 hash.update(
647 `entry${chunkGraph.getModuleId(m)}${
648 /** @type {ChunkGroup} */ (chunkGroup).id
649 }`
650 );
651 }
652 }
653
654 /**
655 * Gets all async chunks.

Callers 7

getHashMethod · 0.45
_createModuleHashMethod · 0.45
processChunkMethod · 0.45
createHashMethod · 0.45
hashWithFunction · 0.45

Calls 7

addMethod · 0.95
updateHashMethod · 0.95
getModuleIdMethod · 0.80
updateMethod · 0.45
getModuleHashMethod · 0.45

Tested by

no test coverage detected