Skip to content

Commit

Permalink
docs(api): add Compilation.hooks.statsPrinter (#7216)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Mar 25, 2024
1 parent edfc063 commit 82f5652
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/content/api/compilation-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ In this plugin, if the `myOption` is missing, it sets it to an empty array. Addi

### statsFactory

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

- Callback Parameters: `statsFactory` `options`

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

- Callback Parameters: `result` `context`

### statsPrinter

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

- Callback Parameters: `statsPrinter` `options`

#### StatsPrinter.hooks.print

`HookMap`

This hook is called when a part should be printed.

- Callback Parameters: `object` `context`

#### StatsPrinter.hooks.result

`HookMap`

This hook is called for the resulting string for a part.

- Callback Parameters: `result` `context`

0 comments on commit 82f5652

Please sign in to comment.