diff --git a/src/content/plugins/split-chunks-plugin.md b/src/content/plugins/split-chunks-plugin.md index 4c286e910617..49dc0fe3ff5b 100644 --- a/src/content/plugins/split-chunks-plugin.md +++ b/src/content/plugins/split-chunks-plugin.md @@ -10,6 +10,7 @@ contributors: - jacobangel - madhavarshney - sakhisheikh + - superburrito related: - title: webpack's automatic deduplication algorithm example url: https://github.com/webpack/webpack/blob/master/examples/many-pages/README.md @@ -164,7 +165,11 @@ T> `maxSize` takes higher priority than `maxInitialRequest/maxAsyncRequests`. Ac `boolean: true | function (module, chunks, cacheGroupKey) | string` -The name of the split chunk. Providing `true` will automatically generate a name based on chunks and cache group key. Providing a string or function will allow you to use a custom name. If the name matches an entry point name, the entry point will be removed. +The name of the split chunk. Providing `true` will automatically generate a name based on chunks and cache group key. + +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. + +If the `splitChunks.name` matches an [entry point](/configuration/entry-context/#entry) name, the entry point will be removed. T> It is recommended to set `splitChunks.name` to `false` for production builds so that it doesn't change names unnecessarily.