MCPcopy
hub / github.com/webpack/webpack / generate

Method generate

lib/runtime/RuntimeIdRuntimeModule.js:22–31  ·  view source on GitHub ↗

* Generates runtime code for this runtime module. * @returns {string | null} runtime code

()

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 1

getRuntimeIdMethod · 0.80

Tested by

no test coverage detected