// vite.config.js
import { defineConfig, loadEnv } from "file:///D:/work/bandhu-buy/admin/node_modules/.pnpm/vite@4.5.14_@types+node@24.2.0_sass@1.77.6/node_modules/vite/dist/node/index.js";
import { resolve } from "path";
import vue from "file:///D:/work/bandhu-buy/admin/node_modules/.pnpm/@vitejs+plugin-vue@4.6.2_vite@4.5.14_@types+node@24.2.0_sass@1.77.6__vue@3.5.18/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import vueJsx from "file:///D:/work/bandhu-buy/admin/node_modules/.pnpm/@vitejs+plugin-vue-jsx@3.1.0_vite@4.5.14_@types+node@24.2.0_sass@1.77.6__vue@3.5.18/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs";
import PurgeIcons from "file:///D:/work/bandhu-buy/admin/node_modules/.pnpm/vite-plugin-purge-icons@0.9.2_vite@4.5.14_@types+node@24.2.0_sass@1.77.6_/node_modules/vite-plugin-purge-icons/dist/index.mjs";
import viteCompression from "file:///D:/work/bandhu-buy/admin/node_modules/.pnpm/vite-plugin-compression@0.5.1_vite@4.5.14_@types+node@24.2.0_sass@1.77.6_/node_modules/vite-plugin-compression/dist/index.mjs";
import { createSvgIconsPlugin } from "file:///D:/work/bandhu-buy/admin/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@4.5.14_@types+node@24.2.0_sass@1.77.6_/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import UnoCSS from "file:///D:/work/bandhu-buy/admin/node_modules/.pnpm/unocss@66.4.1_postcss@5.2.18_vite@4.5.14_@types+node@24.2.0_sass@1.77.6_/node_modules/unocss/dist/vite.mjs";
var __vite_injected_original_dirname = "D:\\work\\bandhu-buy\\admin";
var vite_config_default = defineConfig(({ command, mode }) => {
  const env = loadEnv(mode, __vite_injected_original_dirname, "SHEEP_");
  console.log(env.SHEEP_PROXY_PREFIX);
  return {
    base: "./",
    envPrefix: "SHEEP_",
    plugins: [
      vue(),
      vueJsx(),
      UnoCSS(),
      viteCompression({ verbose: false }),
      createSvgIconsPlugin({
        iconDirs: [resolve(__vite_injected_original_dirname, "./src/assets/svg")],
        symbolId: "sa-[dir]-[name]"
      }),
      PurgeIcons()
    ],
    resolve: {
      alias: {
        "@": resolve(__vite_injected_original_dirname, "./src")
      }
    },
    css: {
      preprocessorOptions: {
        scss: {}
      }
    },
    server: {
      host: true,
      open: true,
      port: env.SHEEP_DEV_PORT,
      hmr: {
        overlay: true
      },
      // 动态代理配置
      proxy: {
        // 代理所有 API 请求
        [env.SHEEP_PROXY_PREFIX]: {
          target: env.SHEEP_PROXY_TARGET,
          changeOrigin: true,
          rewrite: (path) => path.replace(new RegExp(`^${env.SHEEP_PROXY_PREFIX}`), "")
        }
      }
    },
    build: {
      chunkSizeWarningLimit: 2e3,
      sourcemap: false
    },
    preview: {
      port: env.SHEEP_PREVIEW_PORT
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,[encoded data, 4492 characters]
