MCSManager/frontend/vite.config.ts

47 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-08-20 22:57:10 +08:00
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import Components from "unplugin-vue-components/vite";
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
// https://vitejs.dev/config/
export default defineConfig({
2023-08-20 23:38:22 +08:00
server: {
proxy: {
"/api": {
target: "http://localhost:23333",
2023-08-28 14:41:21 +08:00
changeOrigin: true,
ws: true
2023-11-29 22:48:06 +08:00
},
"/upload_files": {
target: "http://localhost:23333",
changeOrigin: true
2023-08-28 14:41:21 +08:00
},
"/socket.io": {
target: "ws://localhost:23333",
ws: true
2023-08-20 23:38:22 +08:00
}
}
},
2023-08-20 22:57:10 +08:00
plugins: [
vue(),
vueJsx(),
Components({
resolvers: [
AntDesignVueResolver({
2023-08-20 23:38:22 +08:00
importStyle: false // css in js
})
]
})
2023-08-20 22:57:10 +08:00
],
resolve: {
alias: {
2023-09-05 16:03:00 +08:00
"@": fileURLToPath(new URL("./src", import.meta.url)),
"@languages": fileURLToPath(new URL("../languages", import.meta.url))
2023-08-20 23:38:22 +08:00
}
}
2023-08-20 22:57:10 +08:00
});