Registry / devops / rollup-plugin-bundle-hash

rollup-plugin-bundle-hash

JSON →
library1.0.0jsnpmunverified

A Rollup plugin that writes output content hashes to a JSON file. Version 1.0.0 is the current stable release with no ongoing update cadence. It differentiates by using hasha for hashing and supporting custom output file paths, but lacks active maintenance or documentation.

npm install rollup-plugin-bundle-hash
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-BUND
R
rollup-plugin-bundle-hash
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bundleHash
import bundleHash from 'rollup-plugin-bundle-hash'
const bundleHash = require('rollup-plugin-bundle-hash')
ESM default export; CommonJS require may fail if package is not CJS-compatible.
bundleHash (named)
import { bundleHash } from 'rollup-plugin-bundle-hash'
import bundleHash from 'rollup-plugin-bundle-hash'
Named export also available since v1.0.0.
Plugin type (TypeScript)
import type { Plugin } from 'rollup'; import bundleHash from 'rollup-plugin-bundle-hash'
No separate type exports; use Rollup's Plugin type.

Shows basic setup of rollup-plugin-bundle-hash with rollup, outputting hashes to dist/hashes.json.

import bundleHash from 'rollup-plugin-bundle-hash'; import { rollup } from 'rollup'; rollup({ input: 'src/main.js', plugins: [ bundleHash({ file: 'dist/hashes.json', hashLength: 20 }) ], output: { dir: 'dist', format: 'es' } });
Debug
Known issues
deprecatedrollup-plugin-bundle-hash has not been updated in over 3 years; consider using rollup-plugin-hash instead.
fix
Switch to rollup-plugin-hash or a more actively maintained plugin.
affects: >=1.0.0
gotchaThe plugin writes hashes only after the generate phase; ensure the bundle output is complete.
fix
Use with output.write() or output.generate() after rollup.generate().
affects: >=1.0.0
gotchaFile path is relative to current working directory, not rollup output directory.
fix
Provide absolute path or path relative to process.cwd().
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'hasha'
Missing hasha dependency.
fix
Run npm install hasha
TypeError: bundleHash is not a function
Incorrect import syntax (CommonJS require on ESM package).
fix
Use ES module import (import bundleHash from 'rollup-plugin-bundle-hash') or enable CJS interop.
Error: Invalid hash length parameter
hashLength must be a positive number between 1 and 64.
fix
Set hashLength to an integer within 1-64.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
hasharequiredUsed for generating content hashes
rolluprequiredPeer dependency for plugin compatibility
Agent activity
2 hits · last 30 days
node
2
Resources
rollup-plugin-bundle-hash — npm install rollup-plugin-bundle-hash · libregistry