// vite.config.js
import { defineConfig, loadEnv } from "file:///D:/%E6%A1%8C%E9%9D%A2/415/%E7%88%86%E7%82%B8%E7%90%83/JE_102_C/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/%E6%A1%8C%E9%9D%A2/415/%E7%88%86%E7%82%B8%E7%90%83/JE_102_C/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import path from "path";
import Components from "file:///D:/%E6%A1%8C%E9%9D%A2/415/%E7%88%86%E7%82%B8%E7%90%83/JE_102_C/node_modules/unplugin-vue-components/dist/vite.js";
import { AntDesignVueResolver } from "file:///D:/%E6%A1%8C%E9%9D%A2/415/%E7%88%86%E7%82%B8%E7%90%83/JE_102_C/node_modules/unplugin-vue-components/dist/resolvers.js";
import { createSvgIconsPlugin } from "file:///D:/%E6%A1%8C%E9%9D%A2/415/%E7%88%86%E7%82%B8%E7%90%83/JE_102_C/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import postcssPxtoRem from "file:///D:/%E6%A1%8C%E9%9D%A2/415/%E7%88%86%E7%82%B8%E7%90%83/JE_102_C/node_modules/postcss-pxtorem/index.js";
var __vite_injected_original_dirname = "D:\\\u684C\u9762\\415\\\u7206\u70B8\u7403\\JE_102_C";
var vite_config_default = defineConfig(({ command, mode }) => {
  const env = loadEnv(mode, process.cwd());
  console.log(env);
  return {
    base: "./",
    publicDir: "public",
    build: {
      outDir: "dist",
      sourcemap: false,
      minify: "terser",
      terserOptions: {
        compress: {
          //drop_console: true,
          drop_debugger: true
        }
      }
    },
    plugins: [
      vue(),
      createSvgIconsPlugin({
        // 指定需要缓存的图标文件夹
        iconDirs: [path.resolve(process.cwd(), "src/plugin/svg-icon/svgs")],
        // 指定symbolId格式
        symbolId: "[name]"
      }),
      //按需加载
      Components({
        resolvers: [
          AntDesignVueResolver({
            importStyle: false
            // css in js
          })
        ]
      })
    ],
    resolve: {
      alias: {
        "@": path.resolve(__vite_injected_original_dirname, "src")
      }
    },
    server: {
      host: "0.0.0.0",
      // port:'8080',
      proxy: {
        "/api": {
          target: env.VITE_SEVER_URL,
          // target: 'http://192.168.100.15:8000',
          // target: 'http://192.168.1.151:8000',
          // target: 'http://127.0.0.1:8000',
          // target: 'http://192.168.1.5:8000',
          // target: 'http://192.168.1.253:8000',
          changeOrigin: true,
          rewrite: (path2) => path2.replace(/^\/api/, "")
        }
      }
    },
    css: {
      postcss: {
        plugins: [
          postcssPxtoRem({
            rootValue: 192,
            // 按照自己的设计稿修改 1920/10
            unitPrecision: 5,
            // 保留到5位小数
            selectorBlackList: [
              "ignore",
              "tab-bar",
              "tab-bar-item",
              "gasExperimentResult"
            ],
            // 忽略转换正则匹配项
            propList: ["*"],
            replace: true,
            mediaQuery: false,
            minPixelValue: 0
          })
        ]
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,[encoded data, 6084 characters]
