Skip to content

Commit 393431a

Browse files
EugeneHlushkomontogeek
authored andcommitted
docs(config) document optimization.chunkIds (#2727)
* docs(config) document optimization.chunkIds * docs(config) optimization.chunkIds defaults, format strings
1 parent 0341516 commit 393431a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/content/configuration/optimization.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,36 @@ module.exports = {
200200
};
201201
```
202202

203+
## `optimization.chunkIds`
204+
205+
`bool: false` `string: natural, named, size, total-size`
206+
207+
Tells webpack which algorithm to use when choosing chunk ids. Setting `optimization.chunkIds` to `false` tells webpack that none of built-in algorithms should be used, as custom one can be provided via plugin. There are couple of defaults for `optimization.chunkIds`:
208+
209+
- if [`optimization.occurrenceOrder`](#optimization-occurrenceorder) is enabled `optimization.chunkIds` is set to `'total-size'`
210+
- Disregarding previous if, if [`optimization.namedChunks`](#optimization-namedchunks) is enabled `optimization.chunkIds` is set to `'named'`
211+
- if none of the above, `optimization.namedChunks` will be defaulted to `'natural'`
212+
213+
The following string values are supported:
214+
215+
Option | Description
216+
----------------------- | -----------------------
217+
`'natural'` | Numeric ids in order of usage.
218+
`'named'` | Readable ids for better debugging.
219+
`'size'` | Numeric ids focused on minimal initial download size.
220+
`'total-size'` | numeric ids focused on minimal total download size.
221+
222+
__webpack.config.js__
223+
224+
```js
225+
module.exports = {
226+
//...
227+
optimization: {
228+
chunkIds: 'named'
229+
}
230+
};
231+
```
232+
203233
## `optimization.nodeEnv`
204234

205235
`string` `bool: false`

0 commit comments

Comments
 (0)