* Returns the source code that will be included as initialization code. * @param {GenerateContext} context context * @returns {string | Source | undefined} the source code that will be included as initialization code
(context)
| 68 | * @returns {string | Source | undefined} the source code that will be included as initialization code |
| 69 | */ |
| 70 | getContent(context) { |
| 71 | if (this.runtimeCondition === false || !this.content) return ""; |
| 72 | if (this.runtimeCondition === true) return this.content; |
| 73 | const expr = context.runtimeTemplate.runtimeConditionExpression({ |
| 74 | chunkGraph: context.chunkGraph, |
| 75 | runtimeRequirements: context.runtimeRequirements, |
| 76 | runtime: context.runtime, |
| 77 | runtimeCondition: this.runtimeCondition |
| 78 | }); |
| 79 | if (expr === "true") return this.content; |
| 80 | return wrapInCondition(expr, this.content); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Returns the source code that will be included at the end of the module. |
nothing calls this directly
no test coverage detected