From d1d9f00b1bd660842addf5e6b1d1b64c852a9eea Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 5 Nov 2023 17:16:09 +0800 Subject: added hover prefixer --- .../webpack/lib/runtime/RuntimeIdRuntimeModule.js | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js (limited to 'node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js') diff --git a/node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js b/node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js new file mode 100644 index 00000000..1923bafc --- /dev/null +++ b/node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js @@ -0,0 +1,32 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"use strict"; + +const RuntimeGlobals = require("../RuntimeGlobals"); +const RuntimeModule = require("../RuntimeModule"); + +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ + +class RuntimeIdRuntimeModule extends RuntimeModule { + constructor() { + super("runtimeId"); + } + + /** + * @returns {string | null} runtime code + */ + generate() { + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); + const runtime = chunk.runtime; + if (typeof runtime !== "string") + throw new Error("RuntimeIdRuntimeModule must be in a single runtime"); + const id = chunkGraph.getRuntimeId(runtime); + return `${RuntimeGlobals.runtimeId} = ${JSON.stringify(id)};`; + } +} + +module.exports = RuntimeIdRuntimeModule; -- cgit v1.2.3