On this page

new DefinePlugin(definitions): DefinePlugin
Attributes
definitions:<Definitions>
A map of global object definitions

Create a new define plugin

Attributes
definitions:<Definitions>
apply(compiler): void
Attributes
compiler:<Compiler>
the compiler instance
Returns:<void>

Applies the plugin by registering its hooks on the compiler.


Attributes
compilation:<Compilation>
the compilation
the attached hooks

Returns the attached hooks.


  • fn {(value: { key: string; module: NormalModule; version: ValueCacheVersion }) => CodeValuePrimitive} generator function
  • options <true> | <string>[] | <RuntimeValueOptions> options
  • Returns: <RuntimeValue> runtime value

Returns runtime value.

Type:
{undefined | null | string | number | bigint | boolean | Function | RegExp | RuntimeValue | { [index: string]: RecursiveArrayOrRecord<string | number | bigint | boolean | Function | RegExp | RuntimeValue | null | undefined> } | RecursiveArrayOrRecord<undefined | null | string | number | bigint | boolean | Function | RegExp | RuntimeValue>[]}

  • definitions <SyncWaterfallHook><<[Record<string, CodeValue>]>, <Record><<string>, <CodeValue>>>


Type:
{{ [index: string]: RecursiveArrayOrRecord } | RecursiveArrayOrRecord [] | T}