{"id":22126,"library":"rollup-plugin-merge","title":"rollup-plugin-merge","description":"A Rollup plugin to merge multiple JSON files into a single JSON output during the build process. Current stable version is 0.2.1, with no recent updates and a small scope. It supports recursive merging, watching for changes, and optional pretty-printing. Unlike general-purpose merge tools, it integrates directly into Rollup's plugin system. Use with caution due to infrequent maintenance.","status":"active","version":"0.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/zont/rollup-plugin-merge","tags":["javascript","rollup","plugin","rollup plugin","concat","merge","extend","file","files"],"install":[{"cmd":"npm install rollup-plugin-merge","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-merge","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-merge","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; the plugin is designed to work with Rollup plugin system","package":"rollup","optional":true}],"imports":[{"note":"ESM-only; does not support CommonJS require.","wrong":"const merge = require('rollup-plugin-merge')","symbol":"default","correct":"import merge from 'rollup-plugin-merge'"},{"note":"TypeScript users; the package does not ship types, but you can define your own for options.","symbol":"MergeOptions","correct":"import type { MergeOptions } from 'rollup-plugin-merge'"},{"note":"Default import is the only way; no named exports.","wrong":"import { default as merge } from 'rollup-plugin-merge'","symbol":"rollup-plugin-merge","correct":"import merge from 'rollup-plugin-merge'"}],"quickstart":{"code":"import merge from 'rollup-plugin-merge';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'iife',\n    name: 'app'\n  },\n  plugins: [\n    merge({\n      input: ['src/file1.json', 'src/file2.json'],\n      output: 'dist/config.json',\n      recursive: true,\n      prettify: true,\n      watch: true\n    })\n  ]\n};","lang":"javascript","description":"Example of merging two JSON files into a single output during Rollup build with recursive merge and prettification."},"warnings":[{"fix":"Use 'recursive' instead of 'recurisve' in the options object.","message":"The 'recursive' option is misspelled as 'recurisve' in the documentation; use 'recursive' (correct spelling) in config.","severity":"gotcha","affected_versions":"<=0.2.1"},{"fix":"Consider alternatives like @rollup/plugin-json or manual merging.","message":"No updates since 2019; may not work with latest Rollup versions (v3+).","severity":"deprecated","affected_versions":">0.2.1"},{"fix":"Ensure your project is configured for ESM imports.","message":"Plugin uses CJS internally, but package is ESM-only; may cause issues in mixed module environments.","severity":"gotcha","affected_versions":"0.2.1"},{"fix":"Set 'watch: true' only if you want initial copy; use Rollup's watch mode for rebuilds.","message":"Watching ('watch' option) only copies files on start; does not trigger full rebuild.","severity":"gotcha","affected_versions":"0.2.1"}],"env_vars":null,"search_vec":"'0.2.1':26 'build':20 'caution':63 'chang':41 'concat':73 'current':22 'direct':55 'due':64 'extend':75 'file':12,76,77 'general':49 'general-purpos':48 'infrequ':66 'integr':54 'javascript':68 'json':11,16 'mainten':67 'merg':4,9,38,51,74 'multipl':10 'option':43 'output':17 'plugin':3,7,59,70,72 'pretti':45 'pretty-print':44 'print':46 'process':21 'purpos':50 'recent':29 'recurs':37 'rollup':2,6,57,69,71 'rollup-plugin-merg':1 'scope':34 'singl':15 'small':33 'stabl':23 'support':36 'system':60 'tool':52 'unlik':47 'updat':30 'use':61 'version':24 'watch':39","created_at":"2026-04-27T17:03:31.712035+00:00","updated_at":"2026-04-27T17:03:31.712035+00:00","problems":[{"fix":"Use import instead: import merge from 'rollup-plugin-merge'","cause":"Package is ESM-only, but CommonJS require() is used.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported."},{"fix":"Use default import: import merge from 'rollup-plugin-merge'","cause":"Importing the plugin incorrectly (e.g., named import instead of default).","error":"TypeError: merge is not a function"},{"fix":"Run npm install rollup-plugin-merge --save-dev","cause":"Package not installed or missing from node_modules.","error":"Plugin error: Cannot find module 'rollup-plugin-merge'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/zont/rollup-plugin-merge","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-merge","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}