new RuntimeTemplate(): RuntimeTemplate
RuntimeTemplateCompilationstringstringOutputNormalizedWithDefaultsRequestShortenerassignOr(target, value): string
Returns a self-defaulting assignment, using the ||= logical assignment
operator when supported and falling back to target = target || value
otherwise. target is evaluated twice in the fallback, so it must be
side-effect free. The expression evaluates to the resulting value.
Models || only, so target must never hold a legitimate falsy value
(0, "", false) — it would be overwritten; use it for object/array defaults.
asyncModuleFactory({ block, chunkGraph, runtimeRequirements, request }): string
AsyncDependenciesBlockChunkGraphstringstringAsync module factory.
basicFunction(args, body): string
Returns basic function.
blockPromise({ block, message, chunkGraph, runtimeRequirements, originModule }): string
AsyncDependenciesBlockChunkGraphstringModuleimport()
is emitted intostringReturns expression.
comment({ request, chunkName, chunkReason, message, exportName }): string
Returns comment.
concatenation(...args?): string
Returns result expression.
cssServerStyleRegistry(): string
stringExpression for the global registry that collects CSS server-side when there
is no DOM (SSR). An SSR host reads it from globalThis; it is keyed by the
style/chunk identifier and namespaced by output.uniqueName.
defineEsModuleFlagStatement({ exportsArgument, runtimeRequirements }): string
Define es module flag statement.
destructureArray(items, value): string
Returns destructure array code.
destructureObject(items, value): string
Destructure object.
emptyFunction(): string
stringReturns empty function code.
exportFromImport({ moduleGraph, chunkGraph, module, request, exportName, originModule, asiSafe, isCall, callContext, defaultInterop, importVar, initFragments, runtime, runtimeRequirements, dependency, mangleableNamespace }): string
booleanChunkGraphbooleanModuleDependencystringInitFragment<GenerateContext>[]booleanbooleanModuleModuleGraphModulestringRuntimeSpecstringExport from import.
expressionFunction(expression, args?): string
Expression function.
forEach(variable, array, body): string
Returns for each code.
getBuiltinModule(request, access?): string
Reads a node builtin via process.getBuiltinModule(), guarded to stay falsy off node so universal ["node", "web"] bundles don't crash (also falsy on node <22.3).
iife
iife(args, body): string
Returns iIFE code.
importStatement({ update, module, originModule, moduleGraph, chunkGraph, runtimeRequirements, importVar, request, weak, dependency }): [string, string]
ChunkGraphModuleDependencystringModuleModuleGraphModulestringbooleanbooleanReturns the import statement and the compat statement.
isIIFE(): boolean
booleanisModule(): boolean
booleanisNeutralPlatform(): boolean
booleanisUniversalTarget(): boolean
booleanWhether the bundle targets node and web at once (universal ["node", "web"] + output.module), like isUniversalTarget in WebpackOptionsApply.
isWebLikePlatformExpression(): string
stringRuntime expression that is truthy in browser-like environments (a DOM
document or a worker self) and falsy in Node.js. Single source of
truth for branching a universal ("node-or-web") target at runtime.
method(prop, args, body): string
Renders an object-literal method, using method shorthand when supported
and falling back to a prop: function/arrow property otherwise.
missingModule({ request }): string
Returns generated error IIFE.
missingModulePromise({ request }): string
Missing module promise.
missingModuleStatement({ request }): string
Missing module statement.
moduleExports({ module, chunkGraph, request, weak, runtimeRequirements }): string
Returns the expression.
moduleId({ module, chunkGraph, request, weak }): string
ChunkGraphModulestringbooleanstringReturns the expression.
moduleNamespace({ module, chunkGraph, request, strict, weak, runtimeRequirements }): string
Returns the expression.
moduleNamespacePromise({ chunkGraph, block, module, request, message, strict, weak, dependency, runtimeRequirements, originModule }): string
AsyncDependenciesBlockChunkGraphDependencystringModuleModuleimport()
is emitted intostringbooleanbooleanstringModule namespace promise.
moduleRaw({ module, chunkGraph, request, weak, runtimeRequirements }): string
Returns the expression.
objectHasOwn(object, property): string
Returns an own-property check, using Object.hasOwn when supported and
falling back to Object.prototype.hasOwnProperty.call otherwise.
optionalChaining(object, access): string
Guards an access/call on object with optional chaining when supported,
otherwise an equivalent && short-circuit. object is evaluated twice in
the fallback, so it must be side-effect free.
renderConst(): "const" | "let" | "var"
"const" | "let" | "var"Renders return const when it is supported, otherwise let when supported, otherwise var.
renderLet(): "let" | "var"
"let" | "var"Renders return let when it is supported, otherwise var.
renderNodePrefixForCoreModule(mod): string
Renders node prefix for core module.
returningFunction(returnValue, args?): string
Returning function.
runtimeConditionExpression({ chunkGraph, runtime, runtimeCondition, runtimeRequirements }): string
ChunkGraphRuntimeSpecstring | boolean | SortableSet<string>stringRuntime condition expression.
supportNodePrefixForCoreModules(): boolean
booleansupportsAnalyzableEsm(): boolean
booleansupportsArrowFunction(): boolean
booleansupportsAsyncFunction(): boolean
booleansupportsBigIntLiteral(): boolean
booleansupportsConst(): boolean
booleansupportsDestructuring(): boolean
booleansupportsDynamicImport(): boolean
booleansupportsEcmaScriptModuleSyntax(): boolean
booleansupportsForOf(): boolean
booleansupportsGenerator(): boolean
booleansupportsLet(): boolean
booleansupportsLogicalAssignment(): boolean
booleansupportsMethodShorthand(): boolean
booleansupportsModulePreload(): boolean
booleansupportsObjectHasOwn(): boolean
booleansupportsOptionalChaining(): boolean
booleansupportsSpread(): boolean
booleansupportsSymbol(): boolean
booleansupportTemplateLiteral(): boolean
booleansyncModuleFactory({ dependency, chunkGraph, runtimeRequirements, request }): string
ChunkGraphDependencystringstringSync module factory.
throwMissingModuleErrorBlock({ request }): string
Throw missing module error block.
throwMissingModuleErrorFunction({ request }): string
Throw missing module error function.
weakError({ chunkGraph, module, request, idExpr, type }): string
ChunkGraphstringModulestring"promise" | "expression" | "statements"stringReturns the code.