memos/web/vite.config.ts

28 lines
539 B
TypeScript
Raw Normal View History

2021-12-08 23:43:52 +08:00
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
2022-07-10 09:02:56 +08:00
import { resolve } from "path";
2021-12-08 23:43:52 +08:00
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
cors: true,
2022-07-14 19:33:20 +08:00
port: 3000,
2021-12-08 23:43:52 +08:00
proxy: {
"/api": {
2022-02-04 19:17:11 +08:00
target: "http://localhost:8080/",
2021-12-08 23:43:52 +08:00
changeOrigin: true,
},
2022-02-04 19:17:11 +08:00
"/h/": {
2022-02-06 00:13:15 +08:00
target: "http://localhost:8080/",
changeOrigin: true,
},
2021-12-08 23:43:52 +08:00
},
},
2022-07-10 09:02:56 +08:00
resolve: {
alias: {
"@/": `${resolve(__dirname, "src")}/`,
},
},
2021-12-08 23:43:52 +08:00
});