MCPcopy
hub / github.com/webpack/webpack / _initBuildHash

Method _initBuildHash

lib/NormalModule.js:1748–1758  ·  lib/NormalModule.js::NormalModule._initBuildHash

* @param {Compilation} compilation compilation * @private

(compilation)

Source from the content-addressed store, hash-verified

1746 * @private
1747 */
1748 _initBuildHash(compilation) {
1749 const hash = createHash(compilation.outputOptions.hashFunction);
1750 if (this._source) {
1751 hash.update(class="st">"source");
1752 this._source.updateHash(hash);
1753 }
1754 hash.update(class="st">"meta");
1755 hash.update(JSON.stringify(this.buildMeta));
1756 /** @type {NormalModuleBuildInfo} */
1757 (this.buildInfo).hash = hash.digest(class="st">"hex");
1758 }
1759
1760 /**
1761 * Builds the module using the provided compilation context.

Callers 3

buildMethod · 0.95
handleParseErrorMethod · 0.95
handleParseResultMethod · 0.95

Calls 4

createHashFunction · 0.85
updateMethod · 0.45
updateHashMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected