You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/configuration/output.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ auxiliaryComment: {
64
64
65
65
## `output.chunkFilename`
66
66
67
-
`string`
67
+
`string``function`
68
68
69
69
This option determines the name of non-entry chunk files. See [`output.filename`](#output-filename) option for details on the possible values.
70
70
@@ -166,7 +166,7 @@ If multiple modules would result in the same name, [`output.devtoolFallbackModul
166
166
167
167
## `output.filename`
168
168
169
-
`string`
169
+
`string``function`
170
170
171
171
This option determines the name of each output bundle. The bundle is written to the directory specified by the [`output.path`](#output-path) option.
172
172
@@ -206,7 +206,7 @@ Make sure to read the [Caching guide](/guides/caching) for details. There are mo
206
206
207
207
Note this option is called filename but you are still allowed to use something like `"js/[name]/bundle.js"` to create a folder structure.
208
208
209
-
Note this options does not affect output files for on-demand-loaded chunks. For these files the [`output.chunkFilename`](#output-chunkfilename) option is used. It also doesn't affect files created by loaders. For these files see loader options.
209
+
Note this option does not affect output files for on-demand-loaded chunks. For these files the [`output.chunkFilename`](#output-chunkfilename) option is used. Files created by loaders also aren't affected. In this case you would have to try the specific loader's available options.
210
210
211
211
The following substitutions are available in template strings (via webpack's internal [`TemplatedPathPlugin`](https://github.com/webpack/webpack/blob/master/lib/TemplatedPathPlugin.js)):
212
212
@@ -220,6 +220,8 @@ The following substitutions are available in template strings (via webpack's int
220
220
221
221
The lengths of `[hash]` and `[chunkhash]` can be specified using `[hash:16]` (defaults to 20). Alternatively, specify [`output.hashDigestLength`](#output-hashdigestlength) to configure the length globally.
222
222
223
+
If using a function for this option, the function will be passed an object containing the substitutions in the table above.
224
+
223
225
T> When using the [`ExtractTextWebpackPlugin`](/plugins/extract-text-webpack-plugin), use `[contenthash]` to obtain a hash of the extracted file (neither `[hash]` nor `[chunkhash]` work).
224
226
225
227
@@ -245,7 +247,7 @@ An optional salt to update the hash via Node.JS' [`hash.update`](https://nodejs.
245
247
246
248
## `output.hotUpdateChunkFilename`
247
249
248
-
`string`
250
+
`string``function`
249
251
250
252
Customize the filenames of hot update chunks. See [`output.filename`](#output-filename) option for details on the possible values.
251
253
@@ -271,7 +273,7 @@ For details see [`output.jsonpFunction`](#output-jsonpfunction).
271
273
272
274
## `output.hotUpdateMainFilename`
273
275
274
-
`string`
276
+
`string``function`
275
277
276
278
Customize the main hot update filename. See [`output.filename`](#output-filename) option for details on the possible values.
277
279
@@ -607,7 +609,7 @@ Note it also adds some info about tree shaking to the generated bundle.
607
609
608
610
## `output.publicPath`
609
611
610
-
`string`
612
+
`string``function`
611
613
612
614
This is an important option when using on-demand-loading or loading external resources like images, files, etc. If an incorrect value is specified you'll receive 404 errors while loading these resources.
0 commit comments