Skip to content

Commit 82f5652

Browse files
authored
docs(api): add Compilation.hooks.statsPrinter (#7216)
1 parent edfc063 commit 82f5652

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/content/api/compilation-hooks.mdx

+23-1
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ In this plugin, if the `myOption` is missing, it sets it to an empty array. Addi
691691

692692
### statsFactory
693693

694-
This hook provides access to the StatsFactory class for specific options.
694+
This hook provides access to the [`StatsFactory` class](https://github.com/webpack/webpack/blob/main/lib/stats/StatsFactory.js) for specific options.
695695

696696
- Callback Parameters: `statsFactory` `options`
697697

@@ -722,3 +722,25 @@ compilation.hooks.statsFactory.tap('MyPlugin', (statsFactory, options) => {
722722
Called with the result on each level.
723723

724724
- Callback Parameters: `result` `context`
725+
726+
### statsPrinter
727+
728+
This hook provides access to the [`StatsPrinter` class](https://github.com/webpack/webpack/blob/main/lib/stats/StatsPrinter.js) for specific options.
729+
730+
- Callback Parameters: `statsPrinter` `options`
731+
732+
#### StatsPrinter.hooks.print
733+
734+
`HookMap`
735+
736+
This hook is called when a part should be printed.
737+
738+
- Callback Parameters: `object` `context`
739+
740+
#### StatsPrinter.hooks.result
741+
742+
`HookMap`
743+
744+
This hook is called for the resulting string for a part.
745+
746+
- Callback Parameters: `result` `context`

0 commit comments

Comments
 (0)