Skip to content

Commit 0b00341

Browse files
ryandrew14montogeek
authored andcommitted
docs(plugins): clarify function provided to splitChunks.name (#3118)
1 parent 2f99ec9 commit 0b00341

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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
@@ -169,6 +170,8 @@ The name of the split chunk. Providing `true` will automatically generate a name
169170

170171
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.
171172

173+
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.
174+
172175
If the `splitChunks.name` matches an [entry point](/configuration/entry-context/#entry) name, the entry point will be removed.
173176

174177
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)