Stats hooks
StatsFactory
StatsFactory.hooks.extract
A HookMap that is called when generating the specified stats item.
- Type:
HookMap<SyncBailHook<[Record<string, any>, any, StatsFactoryContext], undefined>> - Arguments:
object: result stats item object to which properties should be addeddata: original data of the stats itemStatsFactoryContext: generating context
For the following example, the customProperty attribute is added in the finally generated stats.compilation through MyPlugin:
StatsFactory.hooks.result
A HookMap that is called after generating the specified stats item.
- Type:
HookMap<SyncWaterfallHook<[any, StatsFactoryContext]>> - Arguments:
any: generated stats item resultStatsFactoryContext: generating context
StatsPrinter
StatsPrinter.hooks.print
A HookMap that is called when generating the printed string of the specified stats item.
Return a string to override the printed output. Return undefined, or omit the return value, to let subsequent taps, less specific hooks, or the default printing logic handle the item. An empty string suppresses the output and stops further processing by this bail hook.
- Type:
HookMap<SyncBailHook<[{}, StatsPrinterContext], string | void>> - Arguments:
object: stats item objectStatsPrinterContext: printing context
StatsPrinter.hooks.result
A HookMap that is called after generating the printed string of the specified stats item.
- Type:
HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>> - Arguments:
string: printed string of the stats itemStatsPrinterContext: printing context

