Skip to content

Commit 98c41e8

Browse files
EugeneHlushkomontogeek
authored andcommitted
docs(config) Optimization moduleIds option (#2543)
1 parent c8dd870 commit 98c41e8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/content/configuration/optimization.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,33 @@ module.exports = {
172172
};
173173
```
174174

175+
## `optimization.moduleIds`
176+
177+
`bool: false` `string: natural, named, hashed, size, total-size`
178+
179+
Tells webpack which algorithm to use when choosing module ids. Setting `optimization.moduleIds` to `false` tells webpack that none of built-in algorithms should be used, as custom one can be provided via plugin. By default `optimization.moduleIds` is set to `false`.
180+
181+
The following string values are supported:
182+
183+
Option | Description
184+
--------------------- | -----------------------
185+
`natural` | Numeric ids in order of usage.
186+
`named` | Readable ids for better debugging.
187+
`hashed` | Short hashes as ids for better long term caching.
188+
`size` | Numeric ids focused on minimal initial download size.
189+
`total-size` | numeric ids focused on minimal total download size.
190+
191+
__webpack.config.js__
192+
193+
```js
194+
module.exports = {
195+
//...
196+
optimization: {
197+
moduleIds: 'hashed'
198+
}
199+
};
200+
```
201+
175202
## `optimization.nodeEnv`
176203

177204
`string` `bool: false`

0 commit comments

Comments
 (0)