Skip to content

Commit

Permalink
docs(config): update hashFunction docs based on v4 (#1761)
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneHlushko authored and skipjack committed Jan 16, 2018
1 parent d211af2 commit 4092103
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/content/configuration/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ If multiple modules would result in the same name, [`output.devtoolFallbackModul

`string`

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.
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.

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

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

## `output.hashFunction`

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

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.

``` js
hashFunction: require('metrohash').MetroHash64
```

Make sure that the hashing function will have `update` and `digest` methods available.

## `output.hashSalt`

Expand Down

0 comments on commit 4092103

Please sign in to comment.