// vite.config.js
import path2 from "path";
import pxtorem from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/postcss-pxtorem/index.js";
import { defineConfig, loadEnv } from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/vite/dist/node/index.js";

// vite/plugins/index.js
import vue from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/@vitejs/plugin-vue/dist/index.mjs";

// vite/plugins/auto-import.js
import autoImport from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/unplugin-auto-import/dist/vite.js";
function createAutoImport() {
  return autoImport({
    imports: [
      "vue",
      "vue-router",
      "pinia"
    ],
    dts: false
  });
}

// vite/plugins/auto-import-vant.js
import autoImport2 from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/unplugin-auto-import/dist/vite.js";
import Components from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/unplugin-vue-components/dist/vite.js";
import { VantResolver } from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/@vant/auto-import-resolver/dist/index.js";
function createAutoImportVant() {
  return [
    autoImport2({
      resolvers: [VantResolver()]
    }),
    Components({
      resolvers: [VantResolver()]
    })
  ];
}

// vite/plugins/svg-icon.js
import { createSvgIconsPlugin } from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import path from "path";
function createSvgIcon(isBuild) {
  return createSvgIconsPlugin({
    iconDirs: [path.resolve(process.cwd(), "src/assets/icons/svg")],
    symbolId: "icon-[dir]-[name]",
    svgoOptions: isBuild
  });
}

// vite/plugins/compression.js
import compression from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/vite-plugin-compression/dist/index.mjs";
function createCompression(env) {
  const { VITE_BUILD_COMPRESS } = env;
  const plugin = [];
  if (VITE_BUILD_COMPRESS) {
    const compressList = VITE_BUILD_COMPRESS.split(",");
    if (compressList.includes("gzip")) {
      plugin.push(
        compression({
          ext: ".gz",
          deleteOriginFile: false
        })
      );
    }
    if (compressList.includes("brotli")) {
      plugin.push(
        compression({
          ext: ".br",
          algorithm: "brotliCompress",
          deleteOriginFile: false
        })
      );
    }
  }
  return plugin;
}

// vite/plugins/setup-extend.js
import setupExtend from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js";
function createSetupExtend() {
  return setupExtend({});
}

// vite/plugins/create-html.js
import { createHtmlPlugin } from "file:///C:/Users/lenovo/Desktop/wangxiaolu_linkcenter/node_modules/vite-plugin-html/dist/index.mjs";
function create_html_default(env) {
  return createHtmlPlugin({
    inject: {
      data: {
        systemConfig: {
          title: env.VITE_APP_TITLE,
          env: env.VITE_APP_ENV
        }
      }
    }
  });
}

// vite/plugins/index.js
function createVitePlugins(viteEnv, isBuild = false) {
  const vitePlugins = [vue()];
  vitePlugins.push(...createAutoImportVant());
  vitePlugins.push(createAutoImport());
  vitePlugins.push(createSetupExtend());
  vitePlugins.push(createSvgIcon(isBuild));
  vitePlugins.push(create_html_default(viteEnv));
  isBuild && vitePlugins.push(...createCompression(viteEnv));
  return vitePlugins;
}

// vite.config.js
var __vite_injected_original_dirname = "C:\\Users\\lenovo\\Desktop\\wangxiaolu_linkcenter";
var vite_config_default = defineConfig(({ mode, command }) => {
  const env = loadEnv(mode, process.cwd());
  const { VITE_APP_PUBLIC_PATH } = env;
  return {
    base: VITE_APP_PUBLIC_PATH,
    plugins: createVitePlugins(env, command === "build"),
    resolve: {
      alias: {
        "~": path2.resolve(__vite_injected_original_dirname, "./"),
        "@": path2.resolve(__vite_injected_original_dirname, "./src")
      },
      extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"]
    },
    // vite 相关配置
    server: {
      port: 8085,
      host: true,
      open: true,
      proxy: {
        "/dev-api": {
          target: "http://192.168.100.55:8080",
          // target: 'https://sfa-qa.wxl66.cn/api',
          changeOrigin: true,
          rewrite: (p) => p.replace(/^\/dev-api/, "")
        },
        "/dev-promotion-api": {
          target: "https://sfa-qa.wxl66.cn/promotion-api",
          changeOrigin: true,
          rewrite: (p) => p.replace(/^\/dev-promotion-api/, "")
        },
        "/ql_local": {
          target: "http://192.168.131.48",
          changeOrigin: true,
          rewrite: (p) => p.replace(/^\/ql_local/, "")
        },
        "/bc_local": {
          target: "http://192.168.101.103:8180",
          changeOrigin: true,
          rewrite: (p) => p.replace(/^\/bc_local/, "")
        }
      }
    },
    css: {
      postcss: {
        plugins: [
          {
            postcssPlugin: "internal:charset-removal",
            AtRule: {
              charset: (atRule) => {
                if (atRule.name === "charset") {
                  atRule.remove();
                }
              }
            }
          },
          pxtorem({
            rootValue({ file }) {
              return 37.5;
            },
            propList: ["*"],
            exclude: (file) => {
              if (file.indexOf("login")) return true;
              if (file.indexOf("vant") !== -1) {
                return false;
              } else if (file.indexOf("mobile_views") !== -1) {
                return false;
              } else {
                return true;
              }
            }
          })
        ]
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,[encoded data, 16656 characters]
