Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RuntimeTemplate

Index

Constructors

Properties

compilation: Compilation
contentHashReplacement: string
globalObject: string
outputOptions: OutputNormalized
requestShortener: RequestShortener

Methods

  • Parameters

    • __namedParameters: { block: AsyncDependenciesBlock; chunkGraph: ChunkGraph; request?: string; runtimeRequirements: Set<string> }
      • block: AsyncDependenciesBlock

        the async block

      • chunkGraph: ChunkGraph

        the chunk graph

      • Optional request?: string

        request string used originally

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

    Returns string

  • basicFunction(args?: any, body?: any): string
  • Parameters

    • Optional args: any
    • Optional body: any

    Returns string

  • Parameters

    • __namedParameters: { block: AsyncDependenciesBlock; chunkGraph: ChunkGraph; message: string; runtimeRequirements: Set<string> }
      • block: AsyncDependenciesBlock

        the async block

      • chunkGraph: ChunkGraph

        the chunk graph

      • message: string

        the message

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

    Returns string

  • comment(__namedParameters: { chunkName?: string; chunkReason?: string; exportName?: string; message?: string; request?: string }): string
  • Add a comment

    Parameters

    • __namedParameters: { chunkName?: string; chunkReason?: string; exportName?: string; message?: string; request?: string }
      • Optional chunkName?: string

        name of the chunk referenced

      • Optional chunkReason?: string

        reason information of the chunk

      • Optional exportName?: string

        name of the export

      • Optional message?: string

        additional message

      • Optional request?: string

        request string used originally

    Returns string

  • concatenation(...args: (string | { expr: string })[]): string
  • Parameters

    • Rest ...args: (string | { expr: string })[]

    Returns string

  • defineEsModuleFlagStatement(__namedParameters: { exportsArgument: string; runtimeRequirements: Set<string> }): string
  • Parameters

    • __namedParameters: { exportsArgument: string; runtimeRequirements: Set<string> }
      • exportsArgument: string

        the name of the exports object

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

    Returns string

  • destructureArray(items?: any, value?: any): string
  • Parameters

    • Optional items: any
    • Optional value: any

    Returns string

  • destructureObject(items?: any, value?: any): string
  • Parameters

    • Optional items: any
    • Optional value: any

    Returns string

  • emptyFunction(): "x => {}" | "function() {}"
  • Returns "x => {}" | "function() {}"

  • exportFromImport(__namedParameters: { asiSafe?: boolean; callContext: null | boolean; defaultInterop: boolean; exportName: string | string[]; importVar: string; initFragments: InitFragment<any>[]; isCall: boolean; module: Module; moduleGraph: ModuleGraph; originModule: Module; request: string; runtime: RuntimeSpec; runtimeRequirements: Set<string> }): string
  • Parameters

    • __namedParameters: { asiSafe?: boolean; callContext: null | boolean; defaultInterop: boolean; exportName: string | string[]; importVar: string; initFragments: InitFragment<any>[]; isCall: boolean; module: Module; moduleGraph: ModuleGraph; originModule: Module; request: string; runtime: RuntimeSpec; runtimeRequirements: Set<string> }
      • Optional asiSafe?: boolean

        true, if location is safe for ASI, a bracket can be emitted

      • callContext: null | boolean

        when false, call context will not be preserved

      • defaultInterop: boolean

        when true and accessing the default exports, interop code will be generated

      • exportName: string | string[]

        the export name

      • importVar: string

        the identifier name of the import variable

      • initFragments: InitFragment<any>[]

        init fragments will be added here

      • isCall: boolean

        true, if expression will be called

      • module: Module

        the module

      • moduleGraph: ModuleGraph

        the module graph

      • originModule: Module

        the origin module

      • request: string

        the request

      • runtime: RuntimeSpec

        runtime for which this code will be generated

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

    Returns string

  • expressionFunction(expression?: any, args?: string): string
  • Parameters

    • Optional expression: any
    • Optional args: string

    Returns string

  • forEach(variable?: any, array?: any, body?: any): string
  • Parameters

    • Optional variable: any
    • Optional array: any
    • Optional body: any

    Returns string

  • iife(args?: any, body?: any): string
  • Parameters

    • Optional args: any
    • Optional body: any

    Returns string

  • importStatement(__namedParameters: { chunkGraph: ChunkGraph; importVar: string; module: Module; originModule: Module; request: string; runtimeRequirements: Set<string>; update?: boolean; weak?: boolean }): [string, string]
  • Parameters

    • __namedParameters: { chunkGraph: ChunkGraph; importVar: string; module: Module; originModule: Module; request: string; runtimeRequirements: Set<string>; update?: boolean; weak?: boolean }
      • chunkGraph: ChunkGraph

        the chunk graph

      • importVar: string

        name of the import variable

      • module: Module

        the module

      • originModule: Module

        module in which the statement is emitted

      • request: string

        the request that should be printed as comment

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

      • Optional update?: boolean

        whether a new variable should be created or the existing one updated

      • Optional weak?: boolean

        true, if this is a weak dependency

    Returns [string, string]

  • isIIFE(): undefined | boolean
  • Returns undefined | boolean

  • isModule(): undefined | boolean
  • Returns undefined | boolean

  • missingModule(__namedParameters: { request?: string }): string
  • Parameters

    • __namedParameters: { request?: string }
      • Optional request?: string

        request string used originally

    Returns string

  • missingModulePromise(__namedParameters: { request?: string }): string
  • Parameters

    • __namedParameters: { request?: string }
      • Optional request?: string

        request string used originally

    Returns string

  • missingModuleStatement(__namedParameters: { request?: string }): string
  • Parameters

    • __namedParameters: { request?: string }
      • Optional request?: string

        request string used originally

    Returns string

  • moduleExports(__namedParameters: { chunkGraph: ChunkGraph; module: null | Module; request: string; runtimeRequirements: Set<string>; weak?: boolean }): string
  • Parameters

    • __namedParameters: { chunkGraph: ChunkGraph; module: null | Module; request: string; runtimeRequirements: Set<string>; weak?: boolean }
      • chunkGraph: ChunkGraph

        the chunk graph

      • module: null | Module

        the module

      • request: string

        the request that should be printed as comment

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

      • Optional weak?: boolean

        if the dependency is weak (will create a nice error message)

    Returns string

  • moduleId(__namedParameters: { chunkGraph: ChunkGraph; module: Module; request: string; weak?: boolean }): string
  • Parameters

    • __namedParameters: { chunkGraph: ChunkGraph; module: Module; request: string; weak?: boolean }
      • chunkGraph: ChunkGraph

        the chunk graph

      • module: Module

        the module

      • request: string

        the request that should be printed as comment

      • Optional weak?: boolean

        if the dependency is weak (will create a nice error message)

    Returns string

  • moduleNamespace(__namedParameters: { chunkGraph: ChunkGraph; module: Module; request: string; runtimeRequirements: Set<string>; strict?: boolean; weak?: boolean }): string
  • Parameters

    • __namedParameters: { chunkGraph: ChunkGraph; module: Module; request: string; runtimeRequirements: Set<string>; strict?: boolean; weak?: boolean }
      • chunkGraph: ChunkGraph

        the chunk graph

      • module: Module

        the module

      • request: string

        the request that should be printed as comment

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

      • Optional strict?: boolean

        if the current module is in strict esm mode

      • Optional weak?: boolean

        if the dependency is weak (will create a nice error message)

    Returns string

  • moduleNamespacePromise(__namedParameters: { block?: AsyncDependenciesBlock; chunkGraph: ChunkGraph; message: string; module: Module; request: string; runtimeRequirements: Set<string>; strict?: boolean; weak?: boolean }): string
  • Parameters

    • __namedParameters: { block?: AsyncDependenciesBlock; chunkGraph: ChunkGraph; message: string; module: Module; request: string; runtimeRequirements: Set<string>; strict?: boolean; weak?: boolean }
      • Optional block?: AsyncDependenciesBlock

        the current dependencies block

      • chunkGraph: ChunkGraph

        the chunk graph

      • message: string

        a message for the comment

      • module: Module

        the module

      • request: string

        the request that should be printed as comment

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

      • Optional strict?: boolean

        if the current module is in strict esm mode

      • Optional weak?: boolean

        if the dependency is weak (will create a nice error message)

    Returns string

  • moduleRaw(__namedParameters: { chunkGraph: ChunkGraph; module: null | Module; request: string; runtimeRequirements: Set<string>; weak?: boolean }): string
  • Parameters

    • __namedParameters: { chunkGraph: ChunkGraph; module: null | Module; request: string; runtimeRequirements: Set<string>; weak?: boolean }
      • chunkGraph: ChunkGraph

        the chunk graph

      • module: null | Module

        the module

      • request: string

        the request that should be printed as comment

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

      • Optional weak?: boolean

        if the dependency is weak (will create a nice error message)

    Returns string

  • returningFunction(returnValue?: any, args?: string): string
  • Parameters

    • Optional returnValue: any
    • Optional args: string

    Returns string

  • runtimeConditionExpression(__namedParameters: { chunkGraph: ChunkGraph; runtime?: RuntimeSpec; runtimeCondition?: string | boolean | SortableSet<string>; runtimeRequirements: Set<string> }): string
  • Parameters

    • __namedParameters: { chunkGraph: ChunkGraph; runtime?: RuntimeSpec; runtimeCondition?: string | boolean | SortableSet<string>; runtimeRequirements: Set<string> }
      • chunkGraph: ChunkGraph

        the chunk graph

      • Optional runtime?: RuntimeSpec

        runtime for which this code will be generated

      • Optional runtimeCondition?: string | boolean | SortableSet<string>

        only execute the statement in some runtimes

      • runtimeRequirements: Set<string>

        if set, will be filled with runtime requirements

    Returns string

  • supportTemplateLiteral(): undefined | boolean
  • Returns undefined | boolean

  • supportsArrowFunction(): undefined | boolean
  • Returns undefined | boolean

  • supportsBigIntLiteral(): undefined | boolean
  • Returns undefined | boolean

  • supportsConst(): undefined | boolean
  • Returns undefined | boolean

  • supportsDestructuring(): undefined | boolean
  • Returns undefined | boolean

  • supportsDynamicImport(): undefined | boolean
  • Returns undefined | boolean

  • supportsEcmaScriptModuleSyntax(): undefined | boolean
  • Returns undefined | boolean

  • supportsForOf(): undefined | boolean
  • Returns undefined | boolean

  • supportsOptionalChaining(): undefined | boolean
  • Returns undefined | boolean

  • throwMissingModuleErrorBlock(__namedParameters: { request?: string }): string
  • Parameters

    • __namedParameters: { request?: string }
      • Optional request?: string

        request string used originally

    Returns string

  • throwMissingModuleErrorFunction(__namedParameters: { request?: string }): string
  • Parameters

    • __namedParameters: { request?: string }
      • Optional request?: string

        request string used originally

    Returns string

  • weakError(__namedParameters: { chunkGraph: ChunkGraph; idExpr?: string; module: Module; request: string; type: "promise" | "expression" | "statements" }): string
  • Parameters

    • __namedParameters: { chunkGraph: ChunkGraph; idExpr?: string; module: Module; request: string; type: "promise" | "expression" | "statements" }
      • chunkGraph: ChunkGraph

        the chunk graph

      • Optional idExpr?: string

        expression to use as id expression

      • module: Module

        the module

      • request: string

        the request that should be printed as comment

      • type: "promise" | "expression" | "statements"

        which kind of code should be returned

    Returns string