You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/plugins/progress-plugin.md
+20-12Lines changed: 20 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ contributors:
4
4
- elliottsj
5
5
- EugeneHlushko
6
6
- byzyk
7
+
- smelukov
7
8
---
8
9
9
10
`
@@ -39,26 +40,33 @@ new webpack.ProgressPlugin(handler);
39
40
40
41
When providing an `object` to the `ProgressPlugin`, following properties are supported:
41
42
42
-
-`activeModules` show's active modules count and one active module in progress message
43
-
-`entries` show's entries count in progress message
44
-
-[`handler: function (percentage, message, ...args)`](#providing-function)
45
-
-`modules` show's modules count in progress message
46
-
-`modulesCount` a minimum modules count to start with. Takes effect when `modules` property is enabled.
47
-
-`profile` tells `ProgressPlugin` to collect profile data for progress steps.
48
-
43
+
-`activeModules` (`boolean = false`): Shows active modules count and one active module in progress message.
44
+
-`entries` (`boolean = true`): Shows entries count in progress message.
45
+
-`handler` (See [Providing function](#providing-function))
46
+
-`modules` (`boolean = true`): Shows modules count in progress message.
47
+
-`modulesCount` (`number = 5000`): A minimum modules count to start with. Takes effect when `modules` property is enabled.
48
+
-`profile` (`boolean = false`): Tells `ProgressPlugin` to collect profile data for progress steps.
49
+
-`dependencies` (`boolean = true`): Shows the count of dependencies in progress message.
50
+
-`dependenciesCount` (`number = 10000`): A minimum dependencies count to start with. Takes effect when `dependencies` property is enabled.
51
+
-`percentBy` (`string = null: 'entries' | 'dependencies' | 'modules' | null`): Tells `ProgressPlugin` how to calculate progress percentage.
49
52
50
53
```js
51
54
newwebpack.ProgressPlugin({
55
+
activeModules:false,
52
56
entries:true,
53
-
modules:true,
54
-
modulesCount:100,
55
-
profile:true,
56
-
handler: (percentage, message, ...args) => {
57
+
handler(percentage, message, ...args) {
57
58
// custom logic
58
-
}
59
+
},
60
+
modules:true,
61
+
modulesCount:5000,
62
+
profile:false,
63
+
dependencies:true,
64
+
dependenciesCount:10000,
65
+
percentBy:null
59
66
});
60
67
```
61
68
69
+
> We recommend using `percentBy: 'entries'` setting for projects with [multiple configured entry points](/configuration/entry-context/#entry). Percentage calculation will become more accurate because the amount of entry points is known in advance.
0 commit comments