// vite.config.ts
import { defineConfig, loadEnv } from "file:///C:/Users/zz/Desktop/%E9%A1%B9%E7%9B%AE/Brazil/node_modules/vite/dist/node/index.js";
import vue from "file:///C:/Users/zz/Desktop/%E9%A1%B9%E7%9B%AE/Brazil/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import AutoImport from "file:///C:/Users/zz/Desktop/%E9%A1%B9%E7%9B%AE/Brazil/node_modules/unplugin-auto-import/dist/vite.js";
import Components from "file:///C:/Users/zz/Desktop/%E9%A1%B9%E7%9B%AE/Brazil/node_modules/unplugin-vue-components/dist/vite.mjs";
import { ElementPlusResolver } from "file:///C:/Users/zz/Desktop/%E9%A1%B9%E7%9B%AE/Brazil/node_modules/unplugin-vue-components/dist/resolvers.mjs";
import { VantResolver } from "file:///C:/Users/zz/Desktop/%E9%A1%B9%E7%9B%AE/Brazil/node_modules/@vant/auto-import-resolver/dist/index.esm.mjs";
import { fileURLToPath, URL } from "node:url";
var __vite_injected_original_import_meta_url = "file:///C:/Users/zz/Desktop/%E9%A1%B9%E7%9B%AE/Brazil/vite.config.ts";
var timestamp = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3).toString();
var vite_config_default = defineConfig(({ command, mode }) => {
  const env = loadEnv(mode, process.cwd(), "");
  return {
    base: env.VITE_PUBLIC_PATH,
    // 开发或生产环境服务的公共基础路径
    build: {
      minify: "terser",
      outDir: env.VITE_MODE == "production" ? "dist" : "dist-test",
      // 打包文件的输出目录
      assetsDir: "static",
      // 静态资源的存放目录
      assetsInlineLimit: 4096,
      // 图片转 base64 编码的阈值
      terserOptions: {
        compress: {
          drop_console: JSON.parse(env.VITE_OPEN_CONSOLE),
          drop_debugger: JSON.parse(env.VITE_OPEN_CONSOLE)
        }
      },
      rollupOptions: {
        output: {
          entryFileNames: `assets/[name]_${timestamp}.js`,
          chunkFileNames: `assets/[name]_${timestamp}.js`,
          assetFileNames: `assets/[name]_${timestamp}.[ext]`
        }
      }
    },
    plugins: [
      vue(),
      AutoImport({
        resolvers: [ElementPlusResolver()],
        imports: ["vue", "vue-router"]
      }),
      Components({
        resolvers: [ElementPlusResolver(), VantResolver()]
      })
    ],
    resolve: {
      alias: {
        "@": fileURLToPath(new URL("./src", __vite_injected_original_import_meta_url))
      }
    },
    server: {
      host: "0.0.0.0",
      port: 8081,
      proxy: {
        "/api": {
          target: "http://192.168.0.60:1871",
          changeOrigin: true,
          ws: true,
          secure: false,
          rewrite: (path) => path.replace(/^\/api/, "/")
        }
      }
    },
    css: {
      preprocessorOptions: {
        scss: {
          charset: false,
          additionalData: '@import "./src/assets/styles/variables.scss";'
        }
      },
      postcss: {
        plugins: []
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,[encoded data, 5960 characters]
