mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
[webpack-dev-server] Add httpProxyMiddleware.Filter support to context property of ProxyConfigArrayItem
webpack-dev-server [proxy documentation](https://webpack.js.org/configuration/dev-server/#devserverproxy) gives an example of using Filter function for context property and in reality dev-server supports it. However, it was missing on `@types/webpack-dev-server`.
This commit is contained in:
Vendored
+1
-1
@@ -28,7 +28,7 @@ declare namespace WebpackDevServer {
|
||||
|
||||
type ProxyConfigArrayItem = {
|
||||
path?: string | string[];
|
||||
context?: string | string[]
|
||||
context?: string | string[] | httpProxyMiddleware.Filter
|
||||
} & httpProxyMiddleware.Config;
|
||||
|
||||
type ProxyConfigArray = ProxyConfigArrayItem[];
|
||||
|
||||
@@ -87,6 +87,9 @@ const c3: WebpackDevServer.Configuration = {
|
||||
const c4: WebpackDevServer.Configuration = {
|
||||
writeToDisk: (filePath: string) => true,
|
||||
};
|
||||
const c5: WebpackDevServer.Configuration = {
|
||||
proxy: [{context: (pathname: string) => true}]
|
||||
};
|
||||
|
||||
// API example
|
||||
server = new WebpackDevServer(compiler, config);
|
||||
|
||||
Reference in New Issue
Block a user