Skip to content

Commit 5dd5fb9

Browse files
Merge branch 'master' into issues/3116
2 parents 733e806 + 3ad6ca2 commit 5dd5fb9

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
lines changed

src/content/contribute/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ contributors:
77
- harrynewsome
88
- dhedgecock
99
- tbroadley
10+
- EugeneHlushko
1011
---
1112

1213
The people who contribute to webpack do so for the love of open source, our users and ecosystem, and most importantly, pushing the web forward together. Because of our [Open Collective](https://opencollective.com/webpack) model for funding and transparency, we are able to funnel support and funds through contributors, dependent projects, and the contributor and core teams. To make a donation, simply click the button below...
@@ -29,7 +30,7 @@ The biggest core feature we'd like to provide is an enjoyable development experi
2930
Anybody can help by doing any of the following:
3031

3132
- Ask your employer to use webpack in projects.
32-
- Help us write and maintain the content on this site (see the [writer's guide](/writers-guide)).
33+
- Help us write and maintain the content on this site (see the [writer's guide](/contribute/writers-guide/)).
3334
- Contribute to the [core repository](https://github.com/webpack/webpack).
3435
- Become a backer or sponsor on [open collective](https://opencollective.com/webpack#support).
3536

src/content/plugins/progress-plugin.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@ contributors:
66
- byzyk
77
---
88

9+
`object` `function (percentage: number, message: string, ...args: string[])`
10+
911
The `ProgressPlugin` provides a way to customize how progress is reported during a compilation.
1012

1113
## Usage
1214

13-
Create an instance of `ProgressPlugin` with a handler function which will be called when hooks report progress:
15+
Create an instance of `ProgressPlugin` and provide one of the allowed params.
16+
17+
### Providing `function`
18+
19+
Provide a handler function which will be called when hooks report progress. `handler` function arguments:
20+
21+
- `percentage`: a number between 0 and 1 indicating the completion percentage of the compilation
22+
- `message`: a short description of the currently-executing hook
23+
- `...args`: zero or more additional strings describing the current progress
24+
1425

1526
```js
1627
const handler = (percentage, message, ...args) => {
@@ -21,10 +32,30 @@ const handler = (percentage, message, ...args) => {
2132
new webpack.ProgressPlugin(handler);
2233
```
2334

24-
- `handler` is a function which takes these arguments:
25-
- `percentage`: a number between 0 and 1 indicating the completion percentage of the compilation.
26-
- `message`: a short description of the currently-executing hook.
27-
- `...args`: zero or more additional strings describing the current progress.
35+
### Providing `object`
36+
37+
When providing an `object` to the `ProgressPlugin`, following properties are supported:
38+
39+
- `activeModules: boolean = true` show's active modules count and one active module in progress message
40+
- `entries: boolean = false` show's entries count in progress message
41+
- [`handler: function(percentage, message, ...args)`](#providing-function)
42+
- `modules: boolean = true` show's modules count in progress message
43+
- `modulesCount: number = 500` a minimum modules count to start with. Takes effect when `modules` property is enabled.
44+
- `profile: true | false | null = false` tells `ProgressPlugin` to collect profile data for progress steps.
45+
46+
47+
```js
48+
new webpack.ProgressPlugin({
49+
entries: true,
50+
modules: true,
51+
modulesCount: 100,
52+
profile: true,
53+
handler: (percentage, message, ...args) => {
54+
// custom logic
55+
}
56+
});
57+
```
58+
2859

2960
## Supported Hooks
3061

src/content/plugins/split-chunks-plugin.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ contributors:
1111
- madhavarshney
1212
- sakhisheikh
1313
- superburrito
14+
- ryandrew14
1415
related:
1516
- title: webpack's automatic deduplication algorithm example
1617
url: https://github.com/webpack/webpack/blob/master/examples/many-pages/README.md
@@ -171,6 +172,8 @@ The name of the split chunk. Providing `true` will automatically generate a name
171172

172173
Providing a string or a function allows you to use a custom name. Specifying either a string or a function that always returns the same string will merge all common modules and vendors into a single chunk. This might lead to bigger initial downloads and slow down page loads.
173174

175+
If you choose to specify a function, you may find the `chunk.name` and `chunk.hash` properties (where `chunk` is an element of the `chunks` array) particularly useful in choosing a name for your chunk.
176+
174177
If the `splitChunks.name` matches an [entry point](/configuration/entry-context/#entry) name, the entry point will be removed.
175178

176179
T> It is recommended to set `splitChunks.name` to `false` for production builds so that it doesn't change names unnecessarily.

0 commit comments

Comments
 (0)