Registry / devops / rollup-merge-config

rollup-merge-config

JSON →
library0.0.12jsnpmunverified

Utility to merge multiple Rollup configuration objects with support for custom array and object merging strategies. Current stable version: 0.0.12 (released 2019). Low release cadence (no updates since 2019). Key differentiator: provides array concatenation and object merging specifically tailored for Rollup configs, with optional customizer functions to override default behavior for specific keys. Unlike generic merge libraries (e.g., lodash.merge), it handles Rollup's plugin arrays and nested config structures by default.

npm install rollup-merge-config
INSTALL
IMPORT
SIG · ROLLUP-MERGE-CONFI
R
rollup-merge-config
devopsjavascriptv0.0.12
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.

merge
import { merge } from 'rollup-merge-config'
const merge = require('rollup-merge-config')
ESM only; CommonJS require will return the module object, not the merge function directly.
default
import rollupMergeConfig from 'rollup-merge-config'
const { merge } = require('rollup-merge-config')
Default export is an object containing merge and extend. Named exports are preferred.
extend
import { extend } from 'rollup-merge-config'
Identical to merge function; provided for semantic preference.

Shows basic merging of multiple Rollup config objects with default array concatenation and later-key override.

import { merge } from 'rollup-merge-config'; const baseConfig = { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'cjs' }, plugins: [] }; const clientConfig = { output: { file: 'dist/client.js', format: 'iife' }, plugins: [] }; const serverConfig = { output: { file: 'dist/server.js', format: 'cjs' }, plugins: [] }; // Merge multiple configs; later keys override earlier ones. // Arrays (like plugins) are concatenated. const merged = merge(baseConfig, clientConfig, serverConfig); console.log(merged); // Output: { // input: 'src/index.js', // output: { file: 'dist/server.js', format: 'cjs' }, // plugins: [] // }
Debug
Known issues
gotchaArrays are concatenated by default, not replaced. This may cause duplicate plugins if the same plugin appears in multiple configs.
fix
Use a custom arrayCustomizer to deduplicate, e.g., arrayCustomizer: (a, b, key) => key === 'plugins' ? [...new Set([...a, ...b])] : undefined
affects: >=0.0.0
gotchaProperties with undefined values are not merged and are skipped. If a config explicitly sets a property to undefined, the previous value remains.
fix
Ensure no config sets a property to undefined if you want it removed; use null instead.
affects: >=0.0.0
gotchaDeep nested objects are merged recursively, but only plain objects. Values like instances of classes or functions are replaced, not merged.
fix
If you need to merge non-plain objects, implement a custom objectCustomizer.
affects: >=0.0.0
deprecatedPackage has not been updated since 2019; no TypeScript definitions, no Rollup 3+ support.
fix
Consider using @rollup/pluginutils mergeOptions or manually merging configs.
affects: >=0.0.0
Errors
Common errors & fixes
Uncaught TypeError: merge is not a function
Using default import from CommonJS require where merge is a named export.
fix
Use import { merge } from 'rollup-merge-config' instead of const merge = require('rollup-merge-config').merge
TypeError: config.push is not a function
Misunderstanding that merge can handle arrays of configs like array spread; but merge expects multiple arguments, not an array.
fix
Use merge(config1, config2) or merge(...arrayOfConfigs) with spread, not merge(arrayOfConfigs).
Upgrade
Version history
0.0.12latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Resources