import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
import AutoImport from "unplugin-auto-import/vite";
// import IconsResolver from "unplugin-icons/resolver";
// import Icons from "unplugin-icons/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
import UnoCSS from "unocss/vite";
import vueDevTools from "vite-plugin-vue-devtools";

export default defineConfig({
  plugins: [
    vue(),
    // vueDevTools(),

    AutoImport({
      resolvers: [
        // 自动导入图标组件
        // IconsResolver(),
        ElementPlusResolver(),
      ],
    }),
    Components({
      resolvers: [
        // Auto register icon components
        // 自动注册图标组件
        // IconsResolver({
        //   enabledCollections: ["ep"],
        // }),
        ElementPlusResolver(),
      ],
    }),
    // Icons({
    //   autoInstall: true,
    // }),
  ],
  // server: {
  //   proxy: {
  //     "/api": {
  //       target: "http://10.10.244.197:8081",
  //       changeOrigin: true,
  //     },
  //   },
  // },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"), // 将 @ 映射到 src 目录
    },
  },
});
