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 4092103

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

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
@@ -160,7 +160,7 @@ If multiple modules would result in the same name, [`output.devtoolFallbackModul
160160

161161
`string`
162162

163-
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.
163+
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.
164164

165165
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`.
166166

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

237237
## `output.hashFunction`
238238

239-
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.
239+
`string|function`
240240

241+
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.
242+
243+
``` js
244+
hashFunction: require('metrohash').MetroHash64
245+
```
246+
247+
Make sure that the hashing function will have `update` and `digest` methods available.
241248

242249
## `output.hashSalt`
243250

0 commit comments

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