# Custom Chunks

In react-cli we provide options to create custom chunks.  
This Custom Chunk Option is array of Object
that Object keys are

- `pattern` **{ String | Function | Array<String> }** regex pattern as string and custom logic to split chunks can be defined using function
- `name` **{ String }** chunk name
- `size` **{ Number }** is count which is minimum chunk duplicated or need in chunks

> Since 0.0.1-exp.164.1

extra features in custom chunks :-
for more details [SplitChunkPlugin](https://webpack.js.org/plugins/split-chunks-plugin/) webpack

- `minChunks`: `minChunks` is alias of `size` default value is `2`,
- `rules`: `rules` is same as `pattern` with some easy hooks **(removed after v1.1.5)**
  - use `/` for both windows and linux we will replace internally
  - for `.*` we need to use `*`
  - we can consider rules as regex when the `rules-string` has any of these `*`, `^`, `$`. So if you want regex then kindly use `*` in your `rules-string` for force regex
- `chunks`: by this option we can specify , default value is `all`,
- `priority`: priority default value is `-10 * (index + 2)`,
- `enforce`: enforce default value is `true`,
- `maxSize`: maxSize, default value is `0`,
- `minSize`: minSize, default value is `20000`,
- `reuseExistingChunk` If the current chunk contains modules already split out from the main bundle, it will be reused instead of a new one being generated. This can affect the resulting file name of the chunk.
- `automaticNamePrefix` with this you can specify for chunks created through that specified config. default value `''`.
- `cacheGroupName`: `cacheGroupName` is alias of `name`, But it won't work as chunk name, instead it will just work as key in cacheGroup.
<!-- includeDependency: includeDependency default value is `false` -->
