webpack-merge
Advanced tools
Comparing version 5.5.0 to 5.6.0
# Changelog | ||
## 5.6.0 / 2020-12-11 | ||
- Feat - Support `merge` (`CustomizeRule.Merge`) for objects at `mergeWithRules`. This is useful for merging loader options for example. #163 | ||
## 5.5.0 / 2020-12-10 | ||
@@ -4,0 +8,0 @@ |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
@@ -172,2 +183,6 @@ var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
break; | ||
case types_1.CustomizeRule.Merge: | ||
// @ts-ignore: The assumption here is that both are objects | ||
ret[k] = __assign(__assign({}, v), last(bMatches)[k]); | ||
break; | ||
case types_1.CustomizeRule.Prepend: | ||
@@ -197,2 +212,3 @@ ret[k] = bMatches.length > 0 ? last(bMatches)[k].concat(v) : v; | ||
var currentRule = _a.currentRule, a = _a.a, b = _a.b; | ||
console.log("checking rule", currentRule); | ||
// What if there's no match? | ||
@@ -199,0 +215,0 @@ switch (currentRule) { |
@@ -9,2 +9,3 @@ export declare type Key = string; | ||
Match = "match", | ||
Merge = "merge", | ||
Append = "append", | ||
@@ -11,0 +12,0 @@ Prepend = "prepend", |
@@ -7,2 +7,3 @@ "use strict"; | ||
CustomizeRule["Match"] = "match"; | ||
CustomizeRule["Merge"] = "merge"; | ||
CustomizeRule["Append"] = "append"; | ||
@@ -9,0 +10,0 @@ CustomizeRule["Prepend"] = "prepend"; |
@@ -5,3 +5,3 @@ { | ||
"author": "Juho Vepsalainen <bebraw@gmail.com>", | ||
"version": "5.5.0", | ||
"version": "5.6.0", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "build": "tsc", |
@@ -246,2 +246,10 @@ [![Financial Contributors on Open Collective](https://opencollective.com/webpack-merge/all/badge.svg?label=financial+contributors)](https://opencollective.com/webpack-merge) [![build status](https://secure.travis-ci.org/survivejs/webpack-merge.svg)](http://travis-ci.org/survivejs/webpack-merge) [![codecov](https://codecov.io/gh/survivejs/webpack-merge/branch/master/graph/badge.svg)](https://codecov.io/gh/survivejs/webpack-merge) | ||
**Supported annotations:** | ||
- `match` (`CustomizeRule.Match`) - Optional matcher that scopes merging behavior to a specific part based on similarity (think DOM or jQuery selectors) | ||
- `append` (`CustomizeRule.Append`) - Appends items | ||
- `prepend` (`CustomizeRule.Prepend`) - Prepends items | ||
- `replace` (`CustomizeRule.Replace`) - Replaces items | ||
- `merge` (`CustomizeRule.Merge`) - Merges objects (shallow merge) | ||
## Using with TypeScript | ||
@@ -248,0 +256,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54300
459
315