npm audit warning. #116merge.unique documentation. #103oneOf at merge.smart. #111customizeArray and customizeObject examples. #93merge.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({
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']
}]
}
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. #69merge.smart should not merge rules that have differing enforce fields. #65replace mode for merge.smartStrategy. #63merge.smartStrategy works with higher level nesting like 'module.rules.use': 'prepend'. #64merge.unique helper that plugs into customizeArray. This allows you to force only one plugin of a type to the end result. #58CopyWebpackPlugin handling. #56lodash instead of individual packages as latter has been discontinued. #52merge.smartStrategy(rules, plugins) as that caused other issues (prototype copying for complex cases). That needs a better approach. #55merge.smart. #53Feature - 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.
merge({ entry: {} }) should return the same result as input instead of a function.merge([<object>]) format. This works with all available functions. #46Feature - 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.
merge should not mutate inputs with mismatched keys.postcss in mind. It executes the functions, picks their results, and packs them again.merge.strategy. It literally replaces the old field value with the newer one. #40Feature: 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 of merge.smart and merge.strategy into one. Example:
var output = merge.smartStrategy({
entry: 'prepend',
'module.loaders': 'prepend'
})(object1, object2, object3, ...);
merge.strategy. Now you can customize merging behavior per root level configuration field. Example: merge.strategy({ entry: 'prepend' })(object1, object2, object3, ...);. #17merge.smart. It should pick up module.rules as you might expect now. #35merge.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 you merge. #32merge.smart merge loaders based on their full name instead of first letter. Thanks to @choffmeister. #26.merge.smart to merge configuration if include is defined. Thanks to @blackrabbit99. #20.include/exclude at merge.smart for loader definition too. Thanks to @Whoaa512. #16.include/exclude at merge.smart when its set only in a parent. #15.entry configuration.files field from package.json as it wasn't including the dist correctly.entry array merging behavior logical. Prepend makes sense only for loaders after all. #10concat and by dropping a redundant check. Thanks @davegomez!include or exclude, it will generate separate entries instead of merging. Without this the configuration might change in an unpredictable manner.preLoaders and postLoaders. Previously only loaders were supported.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.merge object/array case (missing bind). The behavior should be correct now.merge.smart. Now merge behaves exactly as in 0.3.0 series.