-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Bug report
In the bundled type delcaration file "types/lib/Server.d.ts", type ProxyConfigArray
is defined to not an array but what its item should be.
Actual Behavior
type ProxyConfigArray = {
path?: string | string[] | undefined;
context?: string | string[] | HttpProxyMiddlewareOptionsFilter | undefined;
} & HttpProxyMiddlewareOptions &
ByPass;
Expected Behavior
Below codes are modified base on @types/webpack-dev-server
codes:
type ProxyConfigArrayItem = {
path?: string | string[] | undefined;
context?: string | string[] | HttpProxyMiddlewareOptionsFilter | undefined;
} & HttpProxyMiddlewareOptions &
ByPass;
type ProxyConfigArray = ProxyConfigArrayItem[];
How Do We Reproduce?
import type { Configuration } from 'webpack-dev-server'
const apiPrefixes: string[] = ['/api/']
const devServerOptions: Configuration = {
proxy: [
{
// TS2322: Type '{ context: string[]; target: string; }' is not assignable to type 'Options'.
// Object literal may only specify known properties, and 'context' does not exist in type 'Options'.
context: apiPrefixes,
target : '',
},
],
}
Please paste the results of npx webpack-cli info
here, and mention other relevant information
Not using webpack-cli.
using webpack-dev-server@4.7.2
using typescript@4.5.4
Metadata
Metadata
Assignees
Labels
No labels