Skip to content

Commit 876f8db

Browse files
committed
Fix proxy option type
1 parent 10c6bc1 commit 876f8db

File tree

5 files changed

+613
-63
lines changed

5 files changed

+613
-63
lines changed

demo/docusaurus.config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@ const config = {
5353
theme: {
5454
customCss: require.resolve("./src/css/custom.css"),
5555
},
56-
proxy: {
57-
"/proxy": {
58-
target: "http://localhost:8091",
59-
pathRewrite: { "^/proxy": "" },
56+
proxy: [
57+
{
58+
"/proxy": {
59+
target: "http://localhost:8091",
60+
pathRewrite: { "^/proxy": "" },
61+
},
6062
},
61-
},
63+
],
6264
}),
6365
],
6466
],

packages/docusaurus-plugin-proxy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"devDependencies": {
2424
"@docusaurus/types": "^3.7.0",
25-
"@types/webpack-dev-server": "^4.7.2"
25+
"webpack-dev-server": "^5.2.2"
2626
},
2727
"engines": {
2828
"node": ">=14"

packages/docusaurus-plugin-proxy/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function pluginOpenAPI(
2020
configureWebpack(): any {
2121
return {
2222
devServer: {
23-
proxy: options,
23+
proxy: options.proxy,
2424
},
2525
};
2626
},

packages/docusaurus-plugin-proxy/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* LICENSE file in the root directory of this source tree.
66
* ========================================================================== */
77

8-
import type { Configuration } from "webpack-dev-server";
8+
import type { ProxyConfigArray } from "webpack-dev-server";
99

1010
export interface PluginOptions {
11-
proxy: Configuration["proxy"];
11+
proxy: ProxyConfigArray | undefined;
1212
}

0 commit comments

Comments
 (0)