Registry / devops / webpack-merge

webpack-merge

JSON →
library6.0.1jsnpmunverified

A specialized merge library designed for webpack configuration objects. Version 6.0.1 is the current stable release, requiring Node >=18.0.0. Unlike generic merge utilities (e.g., Lodash.merge), it concatenates arrays, merges objects, and executes functions before merging—critical for webpack's plugin arrays and nested rules. Ships TypeScript types. Maintained actively, with minor/patch releases every few months.

npm install webpack-merge
INSTALL
IMPORT
SIG · WEBPACK-MERGE
W
webpack-merge
devopsjavascriptv6.0.1
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

merge
import { merge } from 'webpack-merge'
ESM default import pattern. Use named import for 'merge'.
merge
const { merge } = require('webpack-merge')
const merge = require('webpack-merge')
CommonJS requires destructuring; default export is an object with merge as a property.
mergeWithCustomize
import { mergeWithCustomize } from 'webpack-merge'
Named export for custom merging behavior.
customizeArray
import { customizeArray } from 'webpack-merge'
Named export; not a default.

Shows merging a common webpack config with environment-specific overrides using merge().

const { merge } = require('webpack-merge'); const common = { entry: './src/index.js', output: { filename: 'bundle.js' } }; const dev = { mode: 'development', devtool: 'inline-source-map' }; const prod = { mode: 'production', optimization: { minimize: true } }; const env = process.env.NODE_ENV || 'development'; const config = merge(common, env === 'development' ? dev : prod); module.exports = config;
Debug
Known issues
breakingIn v6, Node.js <18 is no longer supported.
fix
Upgrade Node.js to >=18.0.0 or stick with v5.
affects: <6.0.0
breakingDefault merge behavior changed: arrays are concatenated, not replaced.
fix
If you need replacement, use mergeWithCustomize with a customArray function that returns b instead of concatenating.
affects: >=1.0.0
deprecatedmerge.smart and merge.strategy removed in v5.
fix
Use mergeWithCustomize or merge() directly.
affects: >=5.0.0 <6.0.0
gotchaFunctions are executed before merging; if you pass a function returning a config, it will be called and merged.
fix
Wrap function-returning configs in an async wrapper only if you need async behavior; note Promises are not supported.
affects: >=1.0.0
gotchaObjects are merged deeply; nested objects are not replaced by default.
fix
Use mergeWithCustomize with customizeObject if you want replacement semantics.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'webpack-merge'
Package not installed or incorrect import path in older versions.
fix
npm install webpack-merge@6.0.1 and use correct import syntax.
merge is not a function
CommonJS require without destructuring: const merge = require('webpack-merge') returns an object, not function.
fix
Use const { merge } = require('webpack-merge') or import { merge } from 'webpack-merge'.
TypeError: mergeWithCustomize is not a function
Importing as default when it's a named export.
fix
Import as named export: import { mergeWithCustomize } from 'webpack-merge'.
Upgrade
Version history
6.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
webpack-merge — npm install webpack-merge · libregistry