MCSManager/frontend/vite.config.ts

38 lines
823 B
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",
changeOrigin: true
// rewrite: (path) => path.replace(/^\/api/, "")
}
}
},
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-08-20 23:38:22 +08:00
"@": fileURLToPath(new URL("./src", import.meta.url))
}
}
2023-08-20 22:57:10 +08:00
});