source: frontend/node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 926 bytes
RevLine 
[9af201e]1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3*/
4
5"use strict";
6
7const RuntimeGlobals = require("../RuntimeGlobals");
8const RuntimeModule = require("../RuntimeModule");
9
10/** @typedef {import("../Chunk")} Chunk */
11/** @typedef {import("../ChunkGraph")} ChunkGraph */
12
13class RuntimeIdRuntimeModule extends RuntimeModule {
14 constructor() {
15 super("runtimeId");
16 }
17
18 /**
19 * Generates runtime code for this runtime module.
20 * @returns {string | null} runtime code
21 */
22 generate() {
23 const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph);
24 const chunk = /** @type {Chunk} */ (this.chunk);
25 const runtime = chunk.runtime;
26 if (typeof runtime !== "string") {
27 throw new Error("RuntimeIdRuntimeModule must be in a single runtime");
28 }
29 const id = chunkGraph.getRuntimeId(runtime);
30 return `${RuntimeGlobals.runtimeId} = ${JSON.stringify(id)};`;
31 }
32}
33
34module.exports = RuntimeIdRuntimeModule;
Note: See TracBrowser for help on using the repository browser.