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/split-chunks-plugin.md
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ contributors:
7
7
- chrisdothtml
8
8
- EugeneHlushko
9
9
- byzyk
10
+
- jacobangel
10
11
- madhavarshney
11
12
- sakhisheikh
12
13
related:
@@ -23,9 +24,9 @@ Since webpack v4, the `CommonsChunkPlugin` was removed in favor of `optimization
23
24
24
25
## Defaults
25
26
26
-
Out of the box `SplitChunksPlugin` should work great for most users.
27
+
Out of the box `SplitChunksPlugin` should work well for most users.
27
28
28
-
By default it only affects on-demand chunks because changing initial chunks would affect the script tags the HTML file should include to run the project.
29
+
By default it only affects on-demand chunks, because changing initial chunks would affect the script tags the HTML file should include to run the project.
29
30
30
31
webpack will automatically split chunks based on these conditions:
31
32
@@ -38,9 +39,9 @@ When trying to fulfill the last two conditions, bigger chunks are preferred.
38
39
39
40
## Configuration
40
41
41
-
For developers that want to have more control over this functionality, webpack provides a set of options to better fit your needs. If you're changing the configuration, it's a good idea to measure the impact of your changes to ensure there's a real benefit.
42
+
webpack provides a set of options for developers that want more control over this functionality.
42
43
43
-
W> Default configuration was chosen to fit web performance best practices but the optimum strategy for your project might defer depending on the nature of it.
44
+
W> The default configuration was chosen to fit web performance best practices, but the optimal strategy for your project might differ. If you're changing the configuration, you should measure the impact of your changes to ensure there's a real benefit.
44
45
45
46
## `optimization.splitChunks`
46
47
@@ -86,7 +87,7 @@ By default webpack will generate names using origin and name of the chunk (e.g.
86
87
87
88
`function``string`
88
89
89
-
This indicates which chunks will be selected for optimization. If a string is provided, possible values are `all`, `async`, and `initial`. Providing `all` can be particularly powerful because it means that chunks can be shared even between async and non-async chunks.
90
+
This indicates which chunks will be selected for optimization. When a string is provided, valid values are `all`, `async`, and `initial`. Providing `all` can be particularly powerful, because it means that chunks can be shared even between async and non-async chunks.
90
91
91
92
```js
92
93
module.exports= {
@@ -100,7 +101,7 @@ module.exports = {
100
101
};
101
102
```
102
103
103
-
Alternatively, you can provide a function for more control. The return value will indicate whether to include each chunk.
104
+
Alternatively, you may provide a function for more control. The return value will indicate whether to include each chunk.
0 commit comments