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

Method updateHash

lib/html/HtmlGenerator.js:601–618  ·  view source on GitHub ↗

* Updates the hash with the data contributed by this instance. * @param {Hash} hash hash that will be modified * @param {UpdateHashContext} updateHashContext context for updating hash

(hash, updateHashContext)

Source from the content-addressed store, hash-verified

599 * @param {UpdateHashContext} updateHashContext context for updating hash
600 */
601 updateHash(hash, updateHashContext) {
602 hash.update("html");
603 // Source-type set changes when html-type exposure flips; the HMR shim's
604 // `extracting` branch changes when the emit decision flips. They differ
605 // only for `"inline"` (exposes html, but does not emit), so hash both.
606 if (this._shouldExposeHtmlType(updateHashContext.module)) {
607 hash.update("html-type");
608 }
609 if (this._shouldExtract(updateHashContext.module)) {
610 hash.update("extract");
611 }
612 // The HMR shim emits additional self-accept / DOM-patch code that
613 // isn't emitted in non-HMR builds, so the cached codegen must
614 // invalidate when `module.hot` toggles.
615 if (updateHashContext.module.hot) {
616 hash.update("hot");
617 }
618 }
619}
620
621module.exports = HtmlGenerator;

Callers

nothing calls this directly

Calls 3

_shouldExposeHtmlTypeMethod · 0.95
_shouldExtractMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected