webpack-merge
Advanced tools
Comparing version 5.4.1 to 5.5.0
# Changelog | ||
## 5.5.0 / 2020-12-10 | ||
- Feat - Allow `mergeWithRules` to merge based on rules without a match. #151 #159 | ||
## 5.4.1 / 2020-12-08 | ||
@@ -4,0 +8,0 @@ |
@@ -112,2 +112,5 @@ "use strict"; | ||
} | ||
if (typeof currentRule === "string") { | ||
return mergeIndividualRule({ currentRule: currentRule, a: a, b: b }); | ||
} | ||
return undefined; | ||
@@ -192,2 +195,15 @@ } | ||
} | ||
function mergeIndividualRule(_a) { | ||
var currentRule = _a.currentRule, a = _a.a, b = _a.b; | ||
// What if there's no match? | ||
switch (currentRule) { | ||
case types_1.CustomizeRule.Append: | ||
return a.concat(b); | ||
case types_1.CustomizeRule.Prepend: | ||
return b.concat(a); | ||
case types_1.CustomizeRule.Replace: | ||
return b; | ||
} | ||
return a; | ||
} | ||
function last(arr) { | ||
@@ -194,0 +210,0 @@ return arr[arr.length - 1]; |
@@ -5,3 +5,3 @@ { | ||
"author": "Juho Vepsalainen <bebraw@gmail.com>", | ||
"version": "5.4.1", | ||
"version": "5.5.0", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "build": "tsc", |
@@ -153,4 +153,4 @@ [![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) | ||
When the order of elements of the `<field>` in the first configuration differs from the order in the second configuration, the latter is preserved. | ||
When the order of elements of the `<field>` in the first configuration differs from the order in the second configuration, the latter is preserved. | ||
```javascript | ||
@@ -245,3 +245,3 @@ const { mergeWithCustomize, unique } = require("webpack-merge"); | ||
The way it works is that you should annotate fields to match using `match` (or `CustomizeRule.Match` if you are using TypeScript) matching your configuration structure and then use specific strategies to define how particular fields should be transformed. | ||
The way it works is that you should annotate fields to match using `match` (or `CustomizeRule.Match` if you are using TypeScript) matching your configuration structure and then use specific strategies to define how particular fields should be transformed. If a match doesn't exist above a rule, then it will apply the rule automatically. | ||
@@ -248,0 +248,0 @@ ## Using with TypeScript |
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
52783
441