webpack-merge
Advanced tools
Comparing version 5.2.0 to 5.3.0
# Changelog | ||
## 5.3.0 / 2020-10-30 | ||
- 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. | ||
## 5.2.0 / 2020-10-07 | ||
@@ -4,0 +10,0 @@ |
@@ -1,6 +0,5 @@ | ||
import { Configuration } from "webpack"; | ||
import unique from "./unique"; | ||
import { CustomizeRule, ICustomizeOptions, Key } from "./types"; | ||
declare function merge(firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]): Configuration; | ||
declare function mergeWithCustomize(options: ICustomizeOptions): (firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]) => Configuration; | ||
declare function merge<Configuration extends object>(firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]): Configuration; | ||
declare function mergeWithCustomize<Configuration extends object>(options: ICustomizeOptions): (firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]) => Configuration; | ||
declare function customizeArray(rules: { | ||
@@ -12,3 +11,3 @@ [s: string]: CustomizeRule; | ||
}; | ||
declare function mergeWithRules(rules: Rules): (firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]) => Configuration; | ||
declare function mergeWithRules(rules: Rules): (firstConfiguration: object | object[], ...configurations: object[]) => object; | ||
declare function customizeObject(rules: { | ||
@@ -15,0 +14,0 @@ [s: string]: CustomizeRule; |
@@ -5,3 +5,3 @@ { | ||
"author": "Juho Vepsalainen <bebraw@gmail.com>", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"scripts": { | ||
@@ -24,8 +24,8 @@ "build": "tsc", | ||
"devDependencies": { | ||
"@types/webpack": "^4.41.22", | ||
"@types/estree": "0.0.45", | ||
"husky": "^4.3.0", | ||
"tsdx": "^0.14.0", | ||
"tslib": "^2.0.1", | ||
"typescript": "^4.0.3", | ||
"webpack": "^4.44.2" | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.0.3", | ||
"typescript": "^4.0.5", | ||
"webpack": "^5.3.2" | ||
}, | ||
@@ -32,0 +32,0 @@ "repository": { |
@@ -5,5 +5,5 @@ [![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) | ||
_webpack-merge_ provides a `merge` function that concatenates arrays and merges objects creating a new object. If functions are encountered, it will execute them, run the results through the algorithm, and then wrap the returned values within a function again. | ||
**webpack-merge** provides a `merge` function that concatenates arrays and merges objects creating a new object. If functions are encountered, it will execute them, run the results through the algorithm, and then wrap the returned values within a function again. | ||
This behavior is particularly useful in configuring webpack although it has uses beyond it. Whenever you need to merge configuration objects, _webpack-merge_ can come in handy. | ||
This behavior is particularly useful in configuring webpack although it has uses beyond it. Whenever you need to merge configuration objects, **webpack-merge** can come in handy. | ||
@@ -245,2 +245,15 @@ ## **`merge(...configuration | [...configuration])`** | ||
## Using with TypeScript | ||
**webpack-merge** supports TypeScript out of the box. You should pass `Configuration` type from webpack to it as follows: | ||
```typescript | ||
import { Configuration } from "webpack"; | ||
import { merge } from "webpack-merge"; | ||
const config = merge<Configuration>({...}, {...}); | ||
... | ||
``` | ||
## Development | ||
@@ -247,0 +260,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
49674
305
411