Skip to content

Commit 1bc333a

Browse files
EugeneHlushkomontogeek
authored andcommitted
docs(optimization) Document namedModules and namedChunks (#2271)
* docs(config) Document optimization namedModules and namedChunks options * docs(config) add noEmitOnErrors example config to docs
1 parent 27b3552 commit 1bc333a

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

src/content/configuration/optimization.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ Use the `optimization.noEmitOnErrors` to skip the emitting phase whenever there
102102

103103
__webpack.config.js__
104104

105-
106105
```js
107106
module.exports = {
108107
//...
@@ -114,6 +113,40 @@ module.exports = {
114113

115114
W> If you are using webpack [CLI](/api/cli/), the webpack process will not exit with an error code while this plugin is enabled. If you want webpack to "fail" when using the CLI, please check out the [`bail` option](/api/cli/#advanced-options).
116115

116+
## `optimization.namedModules`
117+
118+
`boolean: false`
119+
120+
Tells webpack to use readable module identifiers for better debugging. When `optimization.namedModules` is not set in webpack config, webpack will enable it by default for [mode](/concepts/mode/) `development` and disable for [mode](/concepts/mode/) `production`.
121+
122+
__webpack.config.js__
123+
124+
```js
125+
module.exports = {
126+
//...
127+
optimization: {
128+
namedModules: true
129+
}
130+
};
131+
```
132+
133+
## `optimization.namedChunks`
134+
135+
`boolean: false`
136+
137+
Tells webpack to use readable chunk identifiers for better debugging. This option is enabled by default for [mode](/concepts/mode/) `development` and disabled for [mode](/concepts/mode/) `production` if no option is provided in webpack config.
138+
139+
__webpack.config.js__
140+
141+
```js
142+
module.exports = {
143+
//...
144+
optimization: {
145+
namedChunks: true
146+
}
147+
};
148+
```
149+
117150
## `optimization.nodeEnv`
118151

119152
`string` `bool: false`

0 commit comments

Comments
 (0)