import { fileURLToPath, URL } from "node:url"; import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import Components from "unplugin-vue-components/vite"; import { AntDesignVueResolver } from "unplugin-vue-components/resolvers"; import { createSvgIconsPlugin } from "vite-plugin-svg-icons"; import path from "path"; // https://vitejs.dev/config/ export default defineConfig({ base: process.env.NODE_ENV === "production" ? "./" : "/", build: { outDir: "./dist", emptyOutDir: true, }, // 本地開發:有 server // docker 部屬:註解整個 server // server: { // proxy: { // "/upload": { // target: "https://ibms-Empower.production.mjmtech.com.tw", // changeOrigin: true, // secure: false, // }, // }, // }, plugins: [ vue(), Components({ resolvers: [ AntDesignVueResolver({ importStyle: false, // css in js }), ], }), createSvgIconsPlugin({ iconDirs: [path.resolve(process.cwd(), "src/assets/icon")], symbolId: "icon-[dir]-[name]", }), ], css: { preprocessorOptions: { scss: {}, }, }, resolve: { dedupe: ["vue"], alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), "@ASSET": fileURLToPath(new URL("./src/assets", import.meta.url)), }, }, });