memos/web/vite.config.ts

42 lines
868 B
TypeScript
Raw Normal View History

import { resolve } from "path";
2021-12-08 23:43:52 +08:00
import { defineConfig } from "vite";
2022-12-11 22:15:52 +08:00
import legacy from "@vitejs/plugin-legacy";
import react from "@vitejs/plugin-react-swc";
2021-12-08 23:43:52 +08:00
// https://vitejs.dev/config/
export default defineConfig({
2022-12-11 22:15:52 +08:00
plugins: [
react(),
legacy({
targets: ["defaults", "not IE 11"],
}),
],
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: {
"^/api": {
2022-12-25 10:39:45 +08:00
target: "http://localhost:8081/",
2021-12-08 23:43:52 +08:00
changeOrigin: true,
},
"^/o/": {
2022-12-25 10:39:45 +08:00
target: "http://localhost:8081/",
2022-09-09 07:40:21 +08:00
changeOrigin: true,
},
"^/h/": {
2022-12-25 10:39:45 +08:00
target: "http://localhost:8081/",
changeOrigin: true,
},
"^/u/\\d*/rss.xml": {
2022-12-25 10:39:45 +08:00
target: "http://localhost:8081/",
changeOrigin: true,
},
2021-12-08 23:43:52 +08:00
},
},
resolve: {
alias: {
"@/": `${resolve(__dirname, "src")}/`,
},
},
2021-12-08 23:43:52 +08:00
});