From c6d757a6a1502b917de9fa7221b9cd5d88155a2a Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Tue, 18 Dec 2018 12:51:21 +0400 Subject: [PATCH 1/2] docs(config) document optimization.chunkIds --- src/content/configuration/optimization.md | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/content/configuration/optimization.md b/src/content/configuration/optimization.md index e9dd516d4adf..329a70f44a50 100644 --- a/src/content/configuration/optimization.md +++ b/src/content/configuration/optimization.md @@ -200,6 +200,32 @@ module.exports = { }; ``` +## `optimization.chunkIds` + +`bool: false` `string: natural, named, size, total-size` + +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. By default `optimization.chunkIds` is set to `false`. + +The following string values are supported: + +Option | Description +--------------------- | ----------------------- +`natural` | Numeric ids in order of usage. +`named` | Readable ids for better debugging. +`size` | Numeric ids focused on minimal initial download size. +`total-size` | numeric ids focused on minimal total download size. + +__webpack.config.js__ + +```js +module.exports = { + //... + optimization: { + chunkIds: 'named' + } +}; +``` + ## `optimization.nodeEnv` `string` `bool: false` From 185602922d0ea8ce45079e55cbf66740733aeca1 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Wed, 19 Dec 2018 13:38:38 +0400 Subject: [PATCH 2/2] docs(config) optimization.chunkIds defaults, format strings --- src/content/configuration/optimization.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/content/configuration/optimization.md b/src/content/configuration/optimization.md index 329a70f44a50..1c72ae62d3ec 100644 --- a/src/content/configuration/optimization.md +++ b/src/content/configuration/optimization.md @@ -204,16 +204,20 @@ module.exports = { `bool: false` `string: natural, named, size, total-size` -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. By default `optimization.chunkIds` is set to `false`. +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`: + +- if [`optimization.occurrenceOrder`](#optimization-occurrenceorder) is enabled `optimization.chunkIds` is set to `'total-size'` +- Disregarding previous if, if [`optimization.namedChunks`](#optimization-namedchunks) is enabled `optimization.chunkIds` is set to `'named'` +- if none of the above, `optimization.namedChunks` will be defaulted to `'natural'` The following string values are supported: -Option | Description ---------------------- | ----------------------- -`natural` | Numeric ids in order of usage. -`named` | Readable ids for better debugging. -`size` | Numeric ids focused on minimal initial download size. -`total-size` | numeric ids focused on minimal total download size. +Option | Description +----------------------- | ----------------------- +`'natural'` | Numeric ids in order of usage. +`'named'` | Readable ids for better debugging. +`'size'` | Numeric ids focused on minimal initial download size. +`'total-size'` | numeric ids focused on minimal total download size. __webpack.config.js__