Rollup plugin to append content hashes to bundle filenames using a [hash] placeholder pattern, enabling long-term caching. Current stable version is 1.3.0, last updated in 2019. It supports configurable hash algorithms (md5, sha1, sha256, sha512), truncation via [hash:N], optional manifest generation mapping original to hashed filenames, and a replace option to overwrite the original output. Release cadence is low; package is in maintenance mode. Differentiators include simplicity and explicit manifest support, though it is not actively developed and may lack native Rollup v2+ plugin API compliance.
npm install rollup-plugin-hashVerified import paths — ran on the pinned version, not inferred.
Basic Rollup build with rollup-plugin-hash: generates hashed output filename and writes a manifest file.
Set output.file to the non-hashed name and use plugin's dest option.
Consider alternatives like rollup-plugin-output-manifest or manual hash generation.
Use a single output; for multiple outputs, consider using generateBundle hook plugins.
Always include '[hash]' in dest template.
Add [hash] to dest, e.g., dest: 'bundle.[hash].js'
Use import hash from 'rollup-plugin-hash' (no curly braces).
Run npm install --save-dev rollup-plugin-hash
No dependency data recorded yet.