{"id":27350,"library":"rollup-plugin-bundle-hash","title":"rollup-plugin-bundle-hash","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/danrouse/rollup-plugin-bundle-hash","tags":["javascript","rollup","plugin","hash","hasha"],"install":[{"cmd":"npm install rollup-plugin-bundle-hash","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-bundle-hash","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-bundle-hash","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for generating content hashes","package":"hasha","optional":false},{"reason":"Peer dependency for plugin compatibility","package":"rollup","optional":false}],"imports":[{"note":"ESM default export; CommonJS require may fail if package is not CJS-compatible.","wrong":"const bundleHash = require('rollup-plugin-bundle-hash')","symbol":"bundleHash","correct":"import bundleHash from 'rollup-plugin-bundle-hash'"},{"note":"Named export also available since v1.0.0.","wrong":"import bundleHash from 'rollup-plugin-bundle-hash'","symbol":"bundleHash (named)","correct":"import { bundleHash } from 'rollup-plugin-bundle-hash'"},{"note":"No separate type exports; use Rollup's Plugin type.","wrong":"","symbol":"Plugin type (TypeScript)","correct":"import type { Plugin } from 'rollup'; import bundleHash from 'rollup-plugin-bundle-hash'"}],"quickstart":{"code":"import bundleHash from 'rollup-plugin-bundle-hash';\nimport { rollup } from 'rollup';\n\nrollup({\n  input: 'src/main.js',\n  plugins: [\n    bundleHash({\n      file: 'dist/hashes.json',\n      hashLength: 20\n    })\n  ],\n  output: {\n    dir: 'dist',\n    format: 'es'\n  }\n});","lang":"typescript","description":"Shows basic setup of rollup-plugin-bundle-hash with rollup, outputting hashes to dist/hashes.json."},"warnings":[{"fix":"Switch to rollup-plugin-hash or a more actively maintained plugin.","message":"rollup-plugin-bundle-hash has not been updated in over 3 years; consider using rollup-plugin-hash instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use with output.write() or output.generate() after rollup.generate().","message":"The plugin writes hashes only after the generate phase; ensure the bundle output is complete.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Provide absolute path or path relative to process.cwd().","message":"File path is relative to current working directory, not rollup output directory.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run npm install hasha","cause":"Missing hasha dependency.","error":"Error: Cannot find module 'hasha'"},{"fix":"Use ES module import (import bundleHash from 'rollup-plugin-bundle-hash') or enable CJS interop.","cause":"Incorrect import syntax (CommonJS require on ESM package).","error":"TypeError: bundleHash is not a function"},{"fix":"Set hashLength to an integer within 1-64.","cause":"hashLength must be a positive number between 1 and 64.","error":"Error: Invalid hash length parameter"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}