2022-12-18 21:18:30 +08:00
|
|
|
import { resolve } from "path";
|
2021-12-08 23:43:52 +08:00
|
|
|
import { defineConfig } from "vite";
|
2022-12-11 18:38:29 +08:00
|
|
|
import react from "@vitejs/plugin-react-swc";
|
2021-12-08 23:43:52 +08:00
|
|
|
|
2023-03-01 19:50:43 +08:00
|
|
|
const devProxyServer = "http://localhost:8081/";
|
|
|
|
|
2021-12-08 23:43:52 +08:00
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2023-01-26 00:35:50 +08:00
|
|
|
plugins: [react()],
|
2021-12-08 23:43:52 +08:00
|
|
|
server: {
|
2022-09-09 07:40:21 +08:00
|
|
|
host: "0.0.0.0",
|
2022-12-25 10:39:45 +08:00
|
|
|
port: 3001,
|
2021-12-08 23:43:52 +08:00
|
|
|
proxy: {
|
2022-12-11 18:38:29 +08:00
|
|
|
"^/api": {
|
2023-03-01 19:50:43 +08:00
|
|
|
target: devProxyServer,
|
2021-12-08 23:43:52 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2022-12-11 18:38:29 +08:00
|
|
|
"^/o/": {
|
2023-03-01 19:50:43 +08:00
|
|
|
target: devProxyServer,
|
2022-09-09 07:40:21 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2022-10-26 20:13:02 +08:00
|
|
|
"^/u/\\d*/rss.xml": {
|
2023-03-01 19:50:43 +08:00
|
|
|
target: devProxyServer,
|
2022-10-26 20:13:02 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2023-02-09 21:17:15 +08:00
|
|
|
"/explore/rss.xml": {
|
2023-03-01 19:50:43 +08:00
|
|
|
target: devProxyServer,
|
2023-02-09 21:17:15 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
2021-12-08 23:43:52 +08:00
|
|
|
},
|
|
|
|
},
|
2022-12-18 21:18:30 +08:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"@/": `${resolve(__dirname, "src")}/`,
|
|
|
|
},
|
|
|
|
},
|
2021-12-08 23:43:52 +08:00
|
|
|
});
|