summaryrefslogtreecommitdiff
path: root/node_modules/webpack/lib/runtime/GetFullHashRuntimeModule.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/webpack/lib/runtime/GetFullHashRuntimeModule.js')
-rw-r--r--node_modules/webpack/lib/runtime/GetFullHashRuntimeModule.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/node_modules/webpack/lib/runtime/GetFullHashRuntimeModule.js b/node_modules/webpack/lib/runtime/GetFullHashRuntimeModule.js
new file mode 100644
index 00000000..cf994939
--- /dev/null
+++ b/node_modules/webpack/lib/runtime/GetFullHashRuntimeModule.js
@@ -0,0 +1,30 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+*/
+
+"use strict";
+
+const RuntimeGlobals = require("../RuntimeGlobals");
+const RuntimeModule = require("../RuntimeModule");
+
+/** @typedef {import("../Compilation")} Compilation */
+
+class GetFullHashRuntimeModule extends RuntimeModule {
+ constructor() {
+ super("getFullHash");
+ this.fullHash = true;
+ }
+
+ /**
+ * @returns {string | null} runtime code
+ */
+ generate() {
+ const compilation = /** @type {Compilation} */ (this.compilation);
+ const { runtimeTemplate } = compilation;
+ return `${RuntimeGlobals.getFullHash} = ${runtimeTemplate.returningFunction(
+ JSON.stringify(compilation.hash || "XXXX")
+ )}`;
+ }
+}
+
+module.exports = GetFullHashRuntimeModule;