MCPcopy
hub / github.com/webpack/webpack / getEndContent

Method getEndContent

lib/ConditionalInitFragment.js:88–99  ·  view source on GitHub ↗

* Returns the source code that will be included at the end of the module. * @param {GenerateContext} context context * @returns {string | Source | undefined} the source code that will be included at the end of the module

(context)

Source from the content-addressed store, hash-verified

86 * @returns {string | Source | undefined} the source code that will be included at the end of the module
87 */
88 getEndContent(context) {
89 if (this.runtimeCondition === false || !this.endContent) return "";
90 if (this.runtimeCondition === true) return this.endContent;
91 const expr = context.runtimeTemplate.runtimeConditionExpression({
92 chunkGraph: context.chunkGraph,
93 runtimeRequirements: context.runtimeRequirements,
94 runtime: context.runtime,
95 runtimeCondition: this.runtimeCondition
96 });
97 if (expr === "true") return this.endContent;
98 return wrapInCondition(expr, this.endContent);
99 }
100
101 /**
102 * Returns merged fragment.

Callers

nothing calls this directly

Calls 2

wrapInConditionFunction · 0.85

Tested by

no test coverage detected