Defines the define plugin hooks type used by this module.
new DefinePlugin(definitions): DefinePluginAttributes
definitions:
DefinitionsA map of global object definitions
Returns:
DefinePluginCreate a new define plugin
Attributes
definitions:
DefinitionsgetCompilationHooks:
(compilation: Compilation) => DefinePluginHooksgetMergedDefinitionNode:
(compilation: Compilation, key: string) => MergedDefinitionNodeReturns the merged definition node for a definition key.
Runtime requirements of replacement code referencing the require function.
stringifyMergedDefinition:
(compilation: Compilation, parser: JavascriptParser, node: MergedDefinitionNode, key: string, objKeys?: Set<string> | null) => stringRenders a merged definition node to raw code (object literal for map nodes).
Object literal key code;
__proto__
must be computed to stay an own property.VALUE_DEP_MAIN:
"webpack/DefinePlugin_hash"VALUE_DEP_PREFIX:
"webpack/DefinePlugin "apply(compiler): voidAttributes
Applies the plugin by registering its hooks on the compiler.
Attributes
fn:
(value: { key: string; module: NormalModule; version: ValueCacheVersion }) => CodeValuePrimitivegenerator function
options:
true | string[] | RuntimeValueOptionsoptions
Returns:
RuntimeValueruntime 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>[]Attributes
[index: {string}]CodeValue
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>[] | Map<string, MergedDefinitionNode>Type:
{ [index: string]: RecursiveArrayOrRecord<T> } | RecursiveArrayOrRecord<T>[] | T