// Plugins import vue from "@vitejs/plugin-vue"; // Utilities import { defineConfig } from "vite"; import { fileURLToPath, URL } from "node:url"; import AutoImport from "unplugin-auto-import/vite"; import Components from "unplugin-vue-components/vite"; import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue(), AutoImport({ resolvers: [ElementPlusResolver()], }), Components({ resolvers: [ElementPlusResolver()], }), ], define: { "process.env": {} }, resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, extensions: [".js", ".json", ".jsx", ".mjs", ".ts", ".tsx", ".vue"], }, server: { port: 3000, proxy: { "/api": { target: "http://127.0.0.1:7001/api", changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ""), }, }, }, build: { sourcemap: true, }, });