- Fix - Restore usage of
clone-deep
as there was a corner case wherestructuredClone
did not work as expected. #214
- Chore - Update internal dependencies. As a result, the package needs at least Node 18 to run.
- Chore - Use
structuredClone
overclone-deep
dependency since it is included to Node 18 or above. #214
- Feat - Support object/array-formed condition for
mergeWithRules
. #212
- Feat - Support deep merging when rule is a merge. #193, #206
- Docs - Update
env
example to be webpack 5 compatible. #177, #180 - Feat - Support strings as rules for TypeScript, not just enums. #179, #185
- Fix - Don't merge strings with objects in
mergeWithRules
. #172
- Fix - If there's no match when using
merge
operation withmergeWithRules
, use default merge behavior as a fallback. #167
- Fix - Fix a merge failure for
mergeWithRules
when non-array matches are merged. #166
- Feat - Throw a
TypeError
if trying to usemergeWithRules
with invalid configuration types forappend
/prepend
/merge
operations.
- Fix - Drop extraneous logging.
- Feat - Support
merge
(CustomizeRule.Merge
) for objects atmergeWithRules
. This is useful for merging loader options for example. #163
- Feat - Allow
mergeWithRules
to merge based on rules without a match. #151 #159
- Fix - Allow
mergeUnique
to work with arbitrary order. #161
- Fix - Fall back correctly in
mergeWithRules
for cases that aren't matched. #157 #158 - Fix - Don't throw if using
mergeWithRules
without a rule #151 - Feat - Throw if
undefined
is passed tomerge
as a structure to merge
- Fix - Expose
Configuration
type through a generic to TypeScript to support both webpack 4 and 5 #141 #154
In 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
- Fix - Expose
CustomizeRule
for TypeScript users #147
- Fix - Allow merging a
RegExp
to itself #145
- Fix - Allow overriding an object field with
null
#144
- Fix - Drop
<reference types="webpack-dev-server" />
from index.d.ts #143
- Feature - Expose
merge
asdefault
for backwards-compatibility with TypeScript. Nowimport merge from "webpack-merge";
works there. In CommonJS, the default alias is exposed throughdefault
property due to technical constraints.
- Fix - Don't crash on
merge()
andmerge([])
. Now{}
is returned in these corner cases.
- Fix - Support Node 10 #138
- Fix - Drop tslib dependency by setting
"importHelpers": false,
- Fix - Add tslib to dependencies
- Tech - Optimize build size (UMD isn't needed)
- Documentation - Use CommonJS imports at the examples. #137
- Feature - Support TypeScript out of the box. #84 #86 #95 #110 #112
- 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 together amerge
that fits your case. - Deprecation -
mergeStrategy
has been dropped in favor of usingmergeWithCustomize
withcustomizeArray
andcustomizeObject
. - Deprecation -
merge.multiple
has been dropped as the functionality was too specific and it's better to implement in the user space if needed. - Breaking -
merge
has been moved as a regular import (i.e.import { merge } from 'webpack-merge'
). - Breaking - Merge customization has been moved behind
mergeWithCustomize
. - Breaking - Bump supported Node version to 12
- Feature -
customizeArray
supports wildcards now. Example:'entry.*': 'prepend'
. #45 #99 - Feature - Throw an error in case a
Promise
is being merged. It's better to wrap configuration within aPromise
and merge inside it. #81 - Fix - Drop lodash in favor of simpler dependencies. #134
- Fix - Make
unique
merge from right to left to match behavior elsewhere. #119 - Fix - Make sure
unique
doesn't lose non-unique items to merge. #125
Special 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.
- Fix - Update minimum version of lodash to 4.17.15 in order to avoid
npm audit warning
. #116 - Docs - Improve
merge.unique
documentation. #103 - Docs - Add clear note about precedence. #115
- Feature - Support
oneOf
atmerge.smart
. #111 - Fix - If there's only single array to merge, clone it. #106
- 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
andcustomizeObject
examples. #93
- Feature -
merge.multiple
to allow working with webpack multi-compiler mode. It accepts multiple objects and returns an array you can push to webpack. #74
- Breaking feature -
merge.smart
allows re-ordering loaders like below. #70
merge.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 missinginclude
/exclude
to a parent that has either. This is safer and more predictable behavior than the old one. #69
- Bug fix -
merge.smart
should not merge rules that have differingenforce
fields. #65
- Bug fix - Support
replace
mode formerge.smartStrategy
. #63
- Bug fix - Make sure
merge.smartStrategy
works with higher level nesting like'module.rules.use': 'prepend'
. #64
- Feature - Add
merge.unique
helper that plugs intocustomizeArray
. This allows you to force only one plugin of a type to the end result. #58
- Bug fix - Clear up
CopyWebpackPlugin
handling. #56
- Refactor - Depend only on
lodash
instead of individual packages as latter has been discontinued. #52
- Bug fix - Drop
merge.smartStrategy(rules, plugins)
as that caused other issues (prototype copying for complex cases). That needs a better approach. #55
- Bug fix - Avoid recursion at
merge.smart
. #53
- Feature - Allow
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:
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.
- Bug fix - Support previously undocumented, yet used,
merge([<object>])
format. This works with all available functions. #46
- Feature - Allow
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.
- Feature: Support merging Webpack 2 Rule.use. #38
- Bug fix - Don't concat loaders if the first matching entry's include/exclude doesn't match. #39
- Feature: Add support for merging functions. This feature has been designed
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
- Feature: Add support for recursive definitions at
merge.strategy
. Example:
var output = merge.strategy({
entry: 'prepend',
'module.loaders': 'prepend'
})(object1, object2, object3, ...);
- Feature: Add
merge.smartStrategy
. This combines the ideas ofmerge.smart
andmerge.strategy
into one. Example:
var output = merge.smartStrategy({
entry: 'prepend',
'module.loaders': 'prepend'
})(object1, object2, object3, ...);
- Feature: Add support for
merge.strategy
. Now you can customize merging behavior per root level configuration field. Example:merge.strategy({ entry: 'prepend' })(object1, object2, object3, ...);
. #17
- Feature: Add support for webpack 2 at
merge.smart
. It should pick upmodule.rules
as you might expect now. #35
- Breaking: Rework
merge.smart
so that it appends loaders instead of prepending them. This is the logical thing to do as it allows you to specify behavior better as youmerge
. #32
- Docs: Improve package description. #23.
- Bug fix - Let
merge.smart
merge loaders based on their full name instead of first letter. Thanks to @choffmeister. #26.
- Feature: Allow
merge.smart
to mergeloaders
ifexclude
is the same. Thanks to @mshwery. #21.
- Bug fix: Allow
merge.smart
to merge configuration ifinclude
is defined. Thanks to @blackrabbit99. #20.
- Feature: Support
include/exclude
atmerge.smart
forloader
definition too. Thanks to @Whoaa512. #16.
- Feature: Support
include/exclude
atmerge.smart
when its set only in a parent. #15.
- Feature: Support
include/exclude
atmerge.smart
. Thanks to @siready. #14.
- Feature: Allow existing objects/arrays to be emptied with an empty object/array later in merge. This overriding behavior is useful for example emptying your
entry
configuration.
- Bug fix: webpack-merge should not mutate inputs. #12
- Bug fix: Drop
files
field from package.json as it wasn't including the dist correctly.
- Breaking: Change merging behavior so that only loaders get prepended. The rest follow appending logic. This makes
entry
array merging behavior logical. Prepend makes sense only for loaders after all. #10
- Bug fix: Do not error when there are no matching loaders. Thanks @GreenGremlin!
- Regenerate tarball. The problem was that there were some old dependencies included. Closes #7.
- Improve performance by defaulting to
concat
and by dropping a redundant check. Thanks @davegomez!
- Bug fix: Arrays get merged within nested structures correctly now. Array items are prepended (reverse order compared to earlier). This is related to the change made in 0.6.0. Incidentally this change affects normal merge as well.
- Smart merge: If a loader contains either
include
orexclude
, it will generate separate entries instead of merging. Without this the configuration might change in an unpredictable manner.
- Support
preLoaders
andpostLoaders
. Previously onlyloaders
were supported. - Breaking: Change smart merging behavior for
loaders
field so that it prepends loaders instead of appending them. The benefit of this is that now it's possible to specialize loader setup in a predictable manner. For example you can have a linter set up at the root and expect it to become evaluated first always.
- Fix
merge
object/array case (missingbind
). The behavior should be correct now.
- Breaking: Push smart merging behind
merge.smart
. Nowmerge
behaves exactly as in 0.3.0 series.
- Dropped changelog generator. It's better to write these by hand.
- Breaking: Added smart merging (@GreenGremlin)
- Tweaked changelog generator process.
- Added changelog generator.
- Improved formatting
- Allowed an arbitrary amount of objects to be merged
- Only require lodash modules used by the package (@montogeek)
- Removed lodash.isarray dependency, use Array.isArray standard object
- Improved README example
- Simplified example
- Fixed travis link
- Initial implementation