{"id":22122,"library":"rollup-plugin-manifest-json","title":"rollup-plugin-manifest-json","description":"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.","status":"active","version":"1.7.0","language":"javascript","source_language":"en","source_url":"https://github.com/adamzerella/rollup-plugin-manifest-json","tags":["javascript","rollup-plugin","plugin","manifest.json","manifest","pwa","typescript"],"install":[{"cmd":"npm install rollup-plugin-manifest-json","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-manifest-json","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-manifest-json","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package ships TypeScript types, ESM default export.","wrong":"const manifestJSON = require('rollup-plugin-manifest-json')","symbol":"defaultExport","correct":"import manifestJSON from 'rollup-plugin-manifest-json'"},{"note":"TypeScript only; type import to avoid runtime bundle inclusion.","wrong":"import { ManifestOptions } from 'rollup-plugin-manifest-json'","symbol":"ManifestOptions","correct":"import type { ManifestOptions } from 'rollup-plugin-manifest-json'"},{"note":"Options must be in a single object, not positional arguments.","wrong":"manifestJSON('public/manifest.json', { short_name: 'Test' })","symbol":"plugin call","correct":"manifestJSON({ input: 'public/manifest.json', manifest: { short_name: 'Test' } })"}],"quickstart":{"code":"import manifestJSON from 'rollup-plugin-manifest-json';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'esm',\n  },\n  plugins: [\n    manifestJSON({\n      input: 'public/manifest.json', // required\n      minify: true,\n      manifest: {\n        short_name: 'MyApp',\n        name: 'My Application',\n        start_url: '/',\n        display: 'standalone',\n        background_color: '#ffffff',\n        theme_color: '#000000',\n        icons: [\n          { src: 'icon-192.png', sizes: '192x192', type: 'image/png' },\n          { src: 'icon-512.png', sizes: '512x512', type: 'image/png' },\n        ],\n      },\n    }),\n  ],\n};","lang":"typescript","description":"Generates a manifest.json file for a PWA, merging custom overrides into an existing manifest."},"warnings":[{"fix":"Ensure `input` is a valid path to a manifest JSON file.","message":"The 'input' option is required and must point to an existing JSON file. If omitted or file missing, plugin throws.","severity":"gotcha","affected_versions":"<=1.7.0"},{"fix":"Set `output` to a path inside your Rollup output directory, e.g., `output: 'dist/manifest.webmanifest'`.","message":"The 'output' option defaults to 'public/manifest.json' regardless of Rollup output dir. The file is written relative to the project root.","severity":"gotcha","affected_versions":"<=1.7.0"},{"fix":"Ensure `manifest` overrides are explicit; no nested merging.","message":"If both `input` file and `manifest` object provide the same key, the `manifest` object values overwrite the file values (deep merge not supported).","severity":"gotcha","affected_versions":"<=1.7.0"},{"fix":"Add `minify: false` to options if you need a human-readable manifest.","message":"Minification is enabled by default (minify: true). To preserve formatting, explicitly set `minify: false`.","severity":"gotcha","affected_versions":"<=1.7.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Create the manifest file at the specified path or correct the path in plugin options.","cause":"The manifest file specified in `input` does not exist.","error":"Error: Could not read file: /path/to/manifest.json ENOENT: no such file or directory"},{"fix":"Do not destructure or expect a return value from manifestJSON(); it emits a file into Rollup's output.","cause":"Accessing a property on the result before the plugin has emitted the file; no return value.","error":"TypeError: Cannot read properties of undefined (reading 'short_name')"},{"fix":"Ensure `input` is a plain file path, not a module or URL.","cause":"The plugin tries to import the manifest file in older versions or misconfiguration.","error":"Error: Could not load /path/to/manifest.json (imported by rollup-plugin-manifest-json): ENOENT"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}