Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Detail how return values from augmentChunkHash are used (#3432)
  • Loading branch information
jakearchibald committed Mar 10, 2020
1 parent b43bb7e commit 9d4a49f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/05-plugin-development.md
Expand Up @@ -241,15 +241,15 @@ Kind: `sync, sequential`<br>
Previous Hook: [`banner`](guide/en/#banner), [`footer`](guide/en/#footer), [`intro`](guide/en/#intro), [`outro`](guide/en/#outro).<br>
Next Hook: [`resolveFileUrl`](guide/en/#resolvefileurl) for each use of `import.meta.ROLLUP_FILE_URL_referenceId` and [`resolveImportMeta`](guide/en/#resolveimportmeta) for all other accesses to `import.meta`. Then [`renderChunk`](guide/en/#renderchunk) for each chunk.

Can be used to augment the hash of individual chunks. Called for each Rollup output chunk. Returning a falsy value will not modify the hash.
Can be used to augment the hash of individual chunks. Called for each Rollup output chunk. Returning a falsy value will not modify the hash. Truthy values will be passed to [`hash.update`](https://nodejs.org/dist/latest-v12.x/docs/api/crypto.html#crypto_hash_update_data_inputencoding).

The following plugin will invalidate the hash of chunk `foo` with the timestamp of the last build:

```javascript
// rollup.config.js
augmentChunkHash(chunkInfo) {
if(chunkInfo.name === 'foo') {
return Date.now();
return Date.now().toString();
}
}
```
Expand Down

0 comments on commit 9d4a49f

Please sign in to comment.