Registry / devops / rollup-plugin-manifest-json

rollup-plugin-manifest-json

JSON →
library1.7.0jsnpmunverified

Rollup plugin that generates a web application manifest.json file for Progressive Web Apps (PWAs). It reads an existing manifest, optionally merges overrides, minifies the output, and emits it into the Rollup build directory. Version 1.7.0 (stable, maintained). Distinguishes itself by handling both input file cloning and direct manifest object merging, with built-in minification. Requires the manifest to be a valid JSON file or object. Compared to alternatives like vite-plugin-pwa, this is a focused, zero-dependency plugin for Rollup only.

npm install rollup-plugin-manifest-json
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-MANI
R
rollup-plugin-manifest-json
devopsjavascriptv1.7.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

defaultExport
import manifestJSON from 'rollup-plugin-manifest-json'
const manifestJSON = require('rollup-plugin-manifest-json')
Package ships TypeScript types, ESM default export.
ManifestOptions
import type { ManifestOptions } from 'rollup-plugin-manifest-json'
import { ManifestOptions } from 'rollup-plugin-manifest-json'
TypeScript only; type import to avoid runtime bundle inclusion.
plugin call
manifestJSON({ input: 'public/manifest.json', manifest: { short_name: 'Test' } })
manifestJSON('public/manifest.json', { short_name: 'Test' })
Options must be in a single object, not positional arguments.

Generates a manifest.json file for a PWA, merging custom overrides into an existing manifest.

import manifestJSON from 'rollup-plugin-manifest-json'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'esm', }, plugins: [ manifestJSON({ input: 'public/manifest.json', // required minify: true, manifest: { short_name: 'MyApp', name: 'My Application', start_url: '/', display: 'standalone', background_color: '#ffffff', theme_color: '#000000', icons: [ { src: 'icon-192.png', sizes: '192x192', type: 'image/png' }, { src: 'icon-512.png', sizes: '512x512', type: 'image/png' }, ], }, }), ], };
Debug
Known issues
gotchaThe 'input' option is required and must point to an existing JSON file. If omitted or file missing, plugin throws.
fix
Ensure `input` is a valid path to a manifest JSON file.
affects: <=1.7.0
gotchaThe 'output' option defaults to 'public/manifest.json' regardless of Rollup output dir. The file is written relative to the project root.
fix
Set `output` to a path inside your Rollup output directory, e.g., `output: 'dist/manifest.webmanifest'`.
affects: <=1.7.0
gotchaIf both `input` file and `manifest` object provide the same key, the `manifest` object values overwrite the file values (deep merge not supported).
fix
Ensure `manifest` overrides are explicit; no nested merging.
affects: <=1.7.0
gotchaMinification is enabled by default (minify: true). To preserve formatting, explicitly set `minify: false`.
fix
Add `minify: false` to options if you need a human-readable manifest.
affects: <=1.7.0
Errors
Common errors & fixes
Error: Could not read file: /path/to/manifest.json ENOENT: no such file or directory
The manifest file specified in `input` does not exist.
fix
Create the manifest file at the specified path or correct the path in plugin options.
TypeError: Cannot read properties of undefined (reading 'short_name')
Accessing a property on the result before the plugin has emitted the file; no return value.
fix
Do not destructure or expect a return value from manifestJSON(); it emits a file into Rollup's output.
Error: Could not load /path/to/manifest.json (imported by rollup-plugin-manifest-json): ENOENT
The plugin tries to import the manifest file in older versions or misconfiguration.
fix
Ensure `input` is a plain file path, not a module or URL.
Upgrade
Version history
1.7.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
2
Resources
rollup-plugin-manifest-json — npm install rollup-plugin-manifest-json · libregistry