* Generates runtime code for this runtime module. * @returns {string | null} runtime code
()
| 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 | |
| 34 | module.exports = RuntimeIdRuntimeModule; |
nothing calls this directly
no test coverage detected