rollup-plugin-entrypoint-hashmanifest
raw JSON → 0.1.2 verified Mon Apr 27 auth: no javascript maintenance
A Rollup plugin that generates a hash manifest JSON file for each entrypoint, mapping original entry filenames to their hashed output filenames. Version 0.1.2, last updated in 2018, with no recent releases. It produces a manifest compatible with hashmark and injectassets tools. Alternatives include @rollup/plugin-manifest or custom Rollup hook scripts, but this plugin is simpler for entrypoint-only hashing.
Common errors
error Error: Cannot find module 'rollup-plugin-entrypoint-hashmanifest' ↓
cause Package not installed or wrong import path.
fix
Run npm install rollup-plugin-entrypoint-hashmanifest and ensure import path is correct.
error TypeError: entrypointHashmanifest is not a function ↓
cause Named import used instead of default import.
fix
Use import entrypointHashmanifest from 'rollup-plugin-entrypoint-hashmanifest' (no curly braces).
error The plugin "entrypointHashmanifest" could not be called. Did you forget to call it? ↓
cause Plugin added as a reference instead of calling the function.
fix
Add () after plugin name: entrypointHashmanifest()
Warnings
gotcha The manifestName option must be a valid path within the output directory; otherwise the file may be written to unexpected location. ↓
fix Specify a relative path like 'manifest.json' instead of '/absolute/path/manifest.json'.
gotcha The plugin only generates a manifest for entrypoints, not for all output files. Chunk files are not included. ↓
fix If you need all output files in the manifest, consider using @rollup/plugin-manifest or a custom hook.
deprecated The package has not been updated since 2018 and may not work with Rollup >=2.0 due to hook changes. ↓
fix Test with your Rollup version. For Rollup >=3, use a different plugin like @rollup/plugin-manifest.
Install
npm install rollup-plugin-entrypoint-hashmanifest yarn add rollup-plugin-entrypoint-hashmanifest pnpm add rollup-plugin-entrypoint-hashmanifest Imports
- default wrong
const entrypointHashmanifest = require('rollup-plugin-entrypoint-hashmanifest')correctimport entrypointHashmanifest from 'rollup-plugin-entrypoint-hashmanifest' - entrypointHashmanifest wrong
import { entrypointHashmanifest } from 'rollup-plugin-entrypoint-hashmanifest'correctimport entrypointHashmanifest from 'rollup-plugin-entrypoint-hashmanifest' - type
import type { RollupPluginEntrypointHashmanifestOptions } from 'rollup-plugin-entrypoint-hashmanifest'
Quickstart
// rollup.config.js
import entrypointHashmanifest from 'rollup-plugin-entrypoint-hashmanifest';
export default {
input: ['src/main.js', 'src/worker.js'],
output: {
dir: 'dist',
format: 'es',
entryFileNames: '[name]-[hash].js',
chunkFileNames: '[name]-[hash].js'
},
plugins: [
entrypointHashmanifest({
manifestName: 'my-manifest.json'
})
]
};