mini-rbac/frontend/vite.config.js

36 lines
803 B
JavaScript
Raw Normal View History

2022-09-13 08:53:31 +00:00
import { fileURLToPath, URL } from "node:url";
2022-09-11 10:34:18 +00:00
2022-09-13 08:53:31 +00:00
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import Components from "unplugin-vue-components/vite";
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
2022-09-11 10:34:18 +00:00
// https://vitejs.dev/config/
export default defineConfig({
2022-09-13 08:53:31 +00:00
plugins: [
vue(),
Components({
resolvers: [AntDesignVueResolver()],
}),
],
2022-09-11 10:34:18 +00:00
resolve: {
alias: {
2022-09-13 08:53:31 +00:00
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
2022-09-11 10:34:18 +00:00
},
2022-09-13 08:53:31 +00:00
server: {
proxy: {
// 代理
"/api": {
target: "http://localhost:8000",
2022-09-11 10:34:18 +00:00
changeOrigin: true,
2022-09-13 08:53:31 +00:00
rewrite: (path) => path.replace(/^\/api/, ""),
2022-09-11 10:34:18 +00:00
},
2022-09-13 08:53:31 +00:00
"/socket.io": {
target: "ws://localhost:5000",
ws: true,
},
},
},
});