{"id":22100,"library":"rollup-plugin-json-merge","title":"rollup-plugin-json-merge","description":"A Rollup plugin (v0.0.2, stable but minimal) that merges multiple JSON sources into one output file during bundle build. Supports glob patterns, inline objects, and custom merge functions. Lightweight alternative to manual JSON combination in Rollup pipelines. No major updates since initial release; less feature-rich than @rollup/plugin-json combined with manual merging but simpler for single-file concatenation.","status":"active","version":"0.0.2","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/karolis-sh/rollup-plugin-json-merge","tags":["javascript","rollup","plugin","json","merge"],"install":[{"cmd":"npm install rollup-plugin-json-merge","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-json-merge","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-json-merge","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for file pattern matching in input configuration","package":"glob","optional":false},{"reason":"Peer dependency as a Rollup plugin","package":"rollup","optional":false}],"imports":[{"note":"ESM-only package; use import syntax or dynamic import().","wrong":"const merge = require('rollup-plugin-json-merge')","symbol":"default","correct":"import merge from 'rollup-plugin-json-merge'"},{"note":"Package exports a default function only, not a named export.","wrong":"import { merge } from 'rollup-plugin-json-merge'","symbol":"merge","correct":"import merge from 'rollup-plugin-json-merge'"},{"note":"TypeScript users should import Rollup's Plugin type separately; this package does not export types.","wrong":"type Plugin = { ... }","symbol":"type Plugin","correct":"import type { Plugin } from 'rollup'"}],"quickstart":{"code":"import merge from 'rollup-plugin-json-merge';\nexport default {\n  input: 'src/index.js',\n  output: { dir: 'output', format: 'cjs' },\n  plugins: [\n    merge({\n      input: ['src/part1.json', 'src/part2.json'],\n      fileName: 'combined.json',\n    }),\n  ],\n};","lang":"javascript","description":"Minimal Rollup config that merges two JSON files into one output using the plugin."},"warnings":[{"fix":"Provide custom merge function via options.merge to handle conflicts (e.g., deep merge).","message":"Plugin may not handle conflicting keys across input files; uses shallow assign by default.","severity":"gotcha","affected_versions":"0.x"},{"fix":"Use path.resolve or ensure patterns are correct relative to working directory.","message":"Glob patterns in input must resolve to absolute paths or relative to process.cwd(); no automatic resolution.","severity":"gotcha","affected_versions":"0.x"},{"fix":"Validate input files exist before configuring plugin.","message":"Plugin does not emit warnings for non-existent files; silent failure if no files matched.","severity":"gotcha","affected_versions":"0.x"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install glob --save-dev","cause":"Missing glob peer dependency.","error":"Error: Cannot find module 'glob'"},{"fix":"Use default import: import merge from 'rollup-plugin-json-merge'","cause":"Using named import incorrectly.","error":"TypeError: merge is not a function"},{"fix":"npm install rollup-plugin-json-merge --save-dev","cause":"Package not installed.","error":"Error: Could not resolve 'rollup-plugin-json-merge'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}