source: trip-planner-front/node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js@ 6a80231

Last change on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 685 bytes
Line 
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
10class RuntimeIdRuntimeModule extends RuntimeModule {
11 constructor() {
12 super("runtimeId");
13 }
14
15 /**
16 * @returns {string} runtime code
17 */
18 generate() {
19 const { chunkGraph, chunk } = this;
20 const runtime = chunk.runtime;
21 if (typeof runtime !== "string")
22 throw new Error("RuntimeIdRuntimeModule must be in a single runtime");
23 const id = chunkGraph.getRuntimeId(runtime);
24 return `${RuntimeGlobals.runtimeId} = ${JSON.stringify(id)};`;
25 }
26}
27
28module.exports = RuntimeIdRuntimeModule;
Note: See TracBrowser for help on using the repository browser.