Skip to content

Commit ce8cac4

Browse files
authored
docs(plugins): document createDefaultHandler (webpack#6887)
1 parent 5e889af commit ce8cac4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/content/plugins/progress-plugin.mdx

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ contributors:
66
- EugeneHlushko
77
- byzyk
88
- smelukov
9+
- chenxsan
910
---
1011

1112
The `ProgressPlugin` provides a way to customize how progress is reported during a compilation.
1213

1314
## Usage
1415

15-
Create an instance of `ProgressPlugin` and provide one of the allowed params.
16+
Create an instance of `ProgressPlugin` and provide one of the allowed params, besides, there's a static method `createDefaultHandler` which can be used to customize the default handler.
1617

1718
### Providing `function`
1819

@@ -61,6 +62,17 @@ new webpack.ProgressPlugin({
6162
});
6263
```
6364

65+
### webpack.ProgressPlugin.createDefaultHandler
66+
67+
If the default handler of `ProgressPlugin` does not meet your requirements, you can customize it using the static `ProgressPlugin.createDefaultHandler` method.
68+
69+
```ts
70+
static createDefaultHandler: (
71+
profile: undefined | null | boolean,
72+
logger: WebpackLogger
73+
) => (percentage: number, msg: string, ...args: string[]) => void;
74+
```
75+
6476
## Percentage calculation
6577

6678
By default, progress percentage is calculated based on built modules count and total modules count: `built / total`

0 commit comments

Comments
 (0)