NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #1817 most downloaded on npm
Variant of merge that's useful for webpack configuration
Latest stable
6.0.1
Last release 2 years ago
no release in 18 months
Ships unpredictably
gaps range from 1 weeks to 2.0 years
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
91 releases · first in 2015
Drag across the ruler to compare, or tap a release to open it.
Fix - Restore usage of clone-deep as there was a corner case where structuredClone did not work as expected. #214
clone-deep as there was a corner case where structuredClone did not work as expected. #214Chore - Update internal dependencies. As a result, the package needs at least Node 18 to run.
structuredClone over clone-deep dependency since it is included to Node 18 or above. #214Feat - Support object/array-formed condition for mergeWithRules. #212
mergeWithRules. #212Your coding agent can read these notes before it upgrades. Set up the MCP server →
Feat - Support deep merging when rule is a merge. #193, #206
Docs - Update env example to be webpack 5 compatible. #177, #180
env example to be webpack 5 compatible. #177, #180Fix - Don't merge strings with objects in mergeWithRules. #172
mergeWithRules. #172Fix - If there's no match when using merge operation with mergeWithRules, use default merge behavior as a fallback. #167
merge operation with mergeWithRules, use default merge behavior as a fallback. #167Fix - Fix a merge failure for mergeWithRules when non-array matches are merged. #166
mergeWithRules when non-array matches are merged. #166Feat - Throw a TypeError if trying to use mergeWithRules with invalid configuration types for append/prepend/merge operations.
TypeError if trying to use mergeWithRules with invalid configuration types for append/prepend/merge operations.- Fix - Drop extraneous logging.
Feat - Support merge (CustomizeRule.Merge) for objects at mergeWithRules. This is useful for merging loader options for example. #163
merge (CustomizeRule.Merge) for objects at mergeWithRules. This is useful for merging loader options for example. #163Feat - Allow mergeWithRules to merge based on rules without a match. #151 #159
mergeWithRules to merge based on rules without a match. #151 #159Fix - Allow mergeUnique to work with arbitrary order. #161
mergeUnique to work with arbitrary order. #161Fix - Fall back correctly in mergeWithRules for cases that aren't matched. #157 #158
mergeWithRules for cases that aren't matched. #157 #158mergeWithRules without a rule #151undefined is passed to merge as a structure to mergeFix - Expose Configuration type through a generic to TypeScript to support both webpack 4 and 5 #141 #154
Configuration type through a generic to TypeScript to support both webpack 4 and 5 #141 #154In case you use webpack 4, please change your typing as instructed in the readme as the default type is loose but non-breaking.
Feature - Support advanced merging cases through mergeWithRules #146 #149
mergeWithRules #146 #149Fix - Expose CustomizeRule for TypeScript users #147
CustomizeRule for TypeScript users #147Fix - Allow merging a RegExp to itself #145
RegExp to itself #145Fix - Allow overriding an object field with null #144
null #144Fix - Drop from index.d.ts #143
<reference types="webpack-dev-server" /> from index.d.ts #143Feature - Expose merge as default for backwards-compatibility with TypeScript. Now import merge from "webpack-merge"; works there. In CommonJS, the de
merge as default for backwards-compatibility with TypeScript. Now import merge from "webpack-merge"; works there. In CommonJS, the default alias is exposed through default property due to technical constraints.Fix - Don't crash on merge() and merge([]). Now {} is returned in these corner cases.
merge() and merge([]). Now {} is returned in these corner cases.- Fix - Support Node 10 #138
Fix - Drop tslib dependency by setting "importHelpers": false,
"importHelpers": false,Fix - Add tslib to dependencies
Tech - Optimize build size (UMD isn't needed)
Documentation - Use CommonJS imports at the examples. #137
Deprecation - merge.smart has been dropped as it's tricky to support all the corner cases. Instead, it's better to use the provided utilities to put t…
merge.smart has been dropped as it's tricky to support all the corner cases. Instead, it's better to use the provided utilities to put together a merge that fits your case.mergeStrategy has been dropped in favor of using mergeWithCustomize with customizeArray and customizeObject.merge.multiple has been dropped as the functionality was too specific and it's better to implement in the user space if needed.merge has been moved as a regular import (i.e. import { merge } from 'webpack-merge').mergeWithCustomize.customizeArray supports wildcards now. Example: 'entry.*': 'prepend'. #45 #99Promise is being merged. It's better to wrap configuration within a Promise and merge inside it. #81unique merge from right to left to match behavior elsewhere. #119unique doesn't lose non-unique items to merge. #125Special thanks to Google and Addy Osmani for supporting the work financially as it allowed me to complete the work required by the new major release.
Nothing published for this version
Nothing published for this version
Fix - Update minimum version of lodash to 4.17.15 in order to avoid npm audit warning. #116
npm audit warning. #116merge.unique documentation. #103Feature - Support oneOf at merge.smart. #111
oneOf at merge.smart. #111Nothing published for this version
Maintenance - Remove bitHound from the README as it closed down. #102
Fix - Smart merge respects the existing loader order #79, #101
Maintenance - Update lodash, #97, #98
Docs - Add customizeArray and customizeObject examples. #93
customizeArray and customizeObject examples. #93Feature - merge.multiple to allow working with webpack multi-compiler mode. It accepts multiple objects and returns an array you can push to webpack.
merge.multiple to allow working with webpack multi-compiler mode. It accepts multiple objects and returns an array you can push to webpack. #74Breaking feature - merge.smart allows re-ordering loaders like below. #70
merge.smart allows re-ordering loaders like below. #70merge.smart(
{
loaders: [
{
test: /\.js$/,
loaders: ["babel"],
},
],
},
{
loaders: [
{
test: /\.js$/,
loaders: ["react-hot", "babel"],
},
],
},
);
// will become
{
loaders: [
{
test: /\.js$/,
// order of second argument is respected
loaders: ["react-hot", "babel"],
},
];
}
Breaking fix - merge.smart should not merge a child missing include/exclude to a parent that has either. This is safer and more predictable behavior t
merge.smart should not merge a child missing include/exclude to a parent that has either. This is safer and more predictable behavior than the old one. #69Bug fix - merge.smart should not merge rules that have differing enforce fields. #65
merge.smart should not merge rules that have differing enforce fields. #65Bug fix - Support replace mode for merge.smartStrategy. #63
replace mode for merge.smartStrategy. #63Bug fix - Make sure merge.smartStrategy works with higher level nesting like 'module.rules.use': 'prepend'. #64
merge.smartStrategy works with higher level nesting like 'module.rules.use': 'prepend'. #64Feature - Add merge.unique helper that plugs into customizeArray. This allows you to force only one plugin of a type to the end result. #58
merge.unique helper that plugs into customizeArray. This allows you to force only one plugin of a type to the end result. #58Bug fix - Clear up CopyWebpackPlugin handling. #56
CopyWebpackPlugin handling. #56Refactor - Depend only on lodash instead of individual packages as latter has been discontinued. #52
lodash instead of individual packages as latter has been discontinued. #52Bug fix - Drop merge.smartStrategy(rules, plugins) as that caused other issues (prototype copying for complex cases). That needs a better approach. #5
merge.smartStrategy(rules, plugins) as that caused other issues (prototype copying for complex cases). That needs a better approach. #55Bug fix - Avoid recursion at merge.smart. #53
merge.smart. #53Feature - Allow merge.smartStrategy to merge plugin contents. API: merge.smartStrategy(rules, plugins). #44. Example:
merge.smartStrategy to merge plugin contents. API: merge.smartStrategy(rules, plugins). #44. Example:const output = merge.smartStrategy(
{
entry: 'prepend', // or 'replace'
'module.loaders': 'prepend'
},
['LoaderOptionsPlugin']
)(object1, object2, object3, ...);
Breaking - Disallow overriding configuration with empty arrays/objects (#48). If you want to override, use merge.strategy. Example:
merge.strategy. Example:const a = {
entry: ["foo"],
};
const b = {
entry: [],
};
merge(a, b); // Yields a result, not b like before.
Bug fix - merge({ entry: {} }) should return the same result as input instead of a function.
merge({ entry: {} }) should return the same result as input instead of a function.Bug fix - Support previously undocumented, yet used, merge([ ]) format. This works with all available functions. #46
merge([<object>]) format. This works with all available functions. #46Feature - Allow merge behavior to be customized with overrides. Example:
merge behavior to be customized with overrides. Example:var output = merge({
customizeArray(a, b, key) { return [...a, ...b]; },
customizeObject(a, b, key) { return mergeWith(a, b); }
})(object1, object2, object3, ...);
This allows you to guarantee array uniqueness and so on.
Bug fix - merge should not mutate inputs with mismatched keys.
merge should not mutate inputs with mismatched keys.Nothing published for this version
Feature: Support merging Webpack 2 Rule.use. #38
Nothing published for this version
Feature: Add support for merging functions. This feature has been designed postcss in mind. It executes the functions, picks their results, and packs
postcss in mind. It executes the functions, picks their results, and packs them again.Feature: Add support for 'replace' option at merge.strategy. It literally replaces the old field value with the newer one. #40
merge.strategy. It literally replaces the old field value with the newer one. #40Feature: Add support for recursive definitions at merge.strategy. Example:
merge.strategy. Example:var output = merge.strategy({
entry: 'prepend',
'module.loaders': 'prepend'
})(object1, object2, object3, ...);
merge.smartStrategy. This combines the ideas of merge.smart and merge.strategy into one. Example:var output = merge.smartStrategy({
entry: 'prepend',
'module.loaders': 'prepend'
})(object1, object2, object3, ...);
One column per quarter.