Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ccb3da

Browse filesBrowse files
EugeneHlushkoskipjack
authored andcommitted
docs(config): update hashFunction docs based on v4 (#1761)
1 parent f3c515c commit 8ccb3da
Copy full SHA for 8ccb3da

File tree

1 file changed

+9
-2
lines changed
Filter options

1 file changed

+9
-2
lines changed

‎src/content/configuration/output.md

Copy file name to clipboardExpand all lines: src/content/configuration/output.md
+9-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ If multiple modules would result in the same name, [`output.devtoolFallbackModul
170170

171171
`string`
172172

173-
This option determines the modules namespace used with the [`output.devtoolModuleFilenameTemplate`](#output-devtoolmodulefilenametemplate). When not specified, it will default to the value of: [`output.library`](#output-library). It's use is to prevent source file path collisions in sourcemaps when loading multiple libraries built with webpack.
173+
This option determines the modules namespace used with the [`output.devtoolModuleFilenameTemplate`](#output-devtoolmodulefilenametemplate). When not specified, it will default to the value of: [`output.library`](#output-library). It's used to prevent source file path collisions in sourcemaps when loading multiple libraries built with webpack.
174174

175175
For example, if you have 2 libraries, with namespaces `library1` and `library2`, which both have a file `./src/index.js` (with potentially different contents), they will expose these files as `webpack://library1/./src/index.js` and `webpack://library2/./src/index.js`.
176176

@@ -248,8 +248,15 @@ The prefix length of the hash digest to use, defaults to `20`.
248248

249249
## `output.hashFunction`
250250

251-
The hashing algorithm to use, defaults to `'md5'`. All functions from Node.JS' [`crypto.createHash`](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm) are supported.
251+
`string|function`
252252

253+
The hashing algorithm to use, defaults to `'md5'`. All functions from Node.JS' [`crypto.createHash`](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm) are supported. Since `4.0.0-alpha2`, the `hashFunction` can now be a constructor to a custom hash function. You can provide a non-crypto hash function for performance reasons.
254+
255+
``` js
256+
hashFunction: require('metrohash').MetroHash64
257+
```
258+
259+
Make sure that the hashing function will have `update` and `digest` methods available.
253260

254261
## `output.hashSalt`
255262

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.