On this page

Source Code: lib/DefinePlugin.js#L665
new DefinePlugin(definitions): DefinePlugin
Source Code: lib/DefinePlugin.js#L670
Attributes
definitions:Definitions
Returns:DefinePlugin

Create a new define plugin

Source Code: lib/DefinePlugin.js#L672
DefinePlugin.getCompilationHooks(compilation): { definitions: SyncWaterfallHook<[Record<string, CodeValue>], Record<string, CodeValue>> }
Attributes
compilation:Compilation
Returns:{ definitions: SyncWaterfallHook<[Record<string, CodeValue>], Record<string, CodeValue>> }
DefinePlugin.getMergedDefinitionNode(compilation, key): MergedDefinitionNode
Attributes
DefinePlugin.getRuntimeRequirements(code): string[] | undefined
Attributes
code:string
Returns:string[] | undefined
DefinePlugin.stringifyMergedDefinition(compilation, parser, node, key, objKeys?): string
Attributes
compilation:Compilation
key:string
objKeys:Set<string> | null
Returns:string
DefinePlugin.toPropertyKey(key): string
Attributes
key:string
Returns:string
Type:"webpack/DefinePlugin_hash"
Type:"webpack/DefinePlugin "
definePlugin.apply(compiler): void
Source Code: lib/DefinePlugin.js#L690
Attributes
compiler:Compiler

Applies the plugin by registering its hooks on the compiler.

DefinePlugin.runtimeValue(fn, options?): RuntimeValue
Source Code: lib/DefinePlugin.js#L681
Attributes
fn:(value: { key: string; module: NormalModule; version: ValueCacheVersion }) => CodeValuePrimitive
options:true | string[] | RuntimeValueOptions
Returns:RuntimeValue

Returns runtime value.