Skip to content

Commit

Permalink
docs(plugins): add splitChunks.minSizeReduction (#5614)
Browse files Browse the repository at this point in the history
Co-authored-by: Eugene Hlushko <jhlushko@gmail.com>
  • Loading branch information
snitin315 and EugeneHlushko committed Nov 14, 2021
1 parent eeadfde commit 4d4ce10
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/content/plugins/split-chunks-plugin.mdx
Expand Up @@ -18,6 +18,7 @@ contributors:
- rohrlaf
- jamesgeorge007
- anshumanv
- snitin315
related:
- title: webpack's automatic deduplication algorithm example
url: https://github.com/webpack/webpack/blob/master/examples/many-pages/README.md
Expand Down Expand Up @@ -167,10 +168,18 @@ Prevents exposing path info when creating names for parts splitted by maxSize.

### splitChunks.minSize

`number = 20000`
`number = 20000` `{ [index: string]: number }`

Minimum size, in bytes, for a chunk to be generated.

### splitChunks.minSizeReduction

`number` `{ [index: string]: number }`

Minimum size reduction to the main chunk (bundle), in bytes, needed for a chunk to be generated. Meaning if splitting into a chunk does not reduce the size of the main chunk (bundle) by the given amount of bytes, it won't be split, even if it meets the `splitChunks.minSize` value.

T> Both `splitChunks.minSizeReduction` and `splitChunks.minSize` need to be fulfilled for a chunk to be generated.

### splitChunks.enforceSizeThreshold

#### `splitChunks.cacheGroups.{cacheGroup}.enforceSizeThreshold`
Expand Down

1 comment on commit 4d4ce10

@vercel
Copy link

@vercel vercel bot commented on 4d4ce10 Nov 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.