Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions demo/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ const config = {
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
proxy: {
"/proxy": {
proxy: [
{
context: ["/proxy"],
target: "http://localhost:8091",
pathRewrite: { "^/proxy": "" },
},
},
],
}),
],
],
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"@docusaurus/types": "^3.7.0",
"@types/webpack-dev-server": "^4.7.2"
"webpack-dev-server": "^5.2.2"
},
"engines": {
"node": ">=14"
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-proxy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function pluginOpenAPI(
configureWebpack(): any {
return {
devServer: {
proxy: options,
proxy: options.proxy,
},
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-plugin-proxy/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

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

export interface PluginOptions {
proxy: Configuration["proxy"];
proxy: ProxyConfigArray | undefined;
}
2 changes: 1 addition & 1 deletion packages/docusaurus-preset-openapi/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function preset(
}

if (proxy !== false) {
plugins.push(makePluginConfig("docusaurus-plugin-proxy", proxy));
plugins.push(makePluginConfig("docusaurus-plugin-proxy", { proxy }));
}

return { themes, plugins };
Expand Down
Loading