// vite.config.ts
import { loadEnv, defineConfig } from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/vite@4.3.1_@types+node@18.14.2_sass@1.56.1/node_modules/vite/dist/node/index.js";

// vite/plugins/index.ts
import vue from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/@vitejs+plugin-vue@4.0.0_vi_f5ffea0aa712dabdbc8c3aab931e59c7/node_modules/@vitejs/plugin-vue/dist/index.mjs";

// vite/plugins/unocss.ts
import UnoCss from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unocss@0.50.8_postcss@8.5.6_94f38859995f0c6ef792dfb95539cd46/node_modules/unocss/dist/vite.mjs";
import { presetUno, presetAttributify, presetIcons } from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unocss@0.50.8_postcss@8.5.6_94f38859995f0c6ef792dfb95539cd46/node_modules/unocss/dist/index.mjs";
var unocss_default = () => {
  return UnoCss({
    presets: [presetUno(), presetAttributify(), presetIcons()],
    // rules: [['search', {}]],
    shortcuts: {
      "panel-title": "pb-[5px] font-sans leading-[1.1] font-medium text-base text-[#6379bb] border-b border-b-solid border-[var(--el-border-color-light)] mb-5 mt-0"
    },
    hmrTopLevelAwait: false
    // unocss默认是true，低版本浏览器是不支持的，启动后会报错
  });
};

// vite/plugins/auto-import.ts
import AutoImport from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unplugin-auto-import@0.13.0_bf0f23498e7ab5b75b40f2a653fc6f99/node_modules/unplugin-auto-import/dist/vite.js";
import { ElementPlusResolver } from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unplugin-vue-components@0.2_dcf43dd46d08c85c0e81c672b3d3d6b0/node_modules/unplugin-vue-components/dist/resolvers.mjs";
import IconsResolver from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unplugin-icons@0.15.1_@vue+compiler-sfc@3.2.45/node_modules/unplugin-icons/dist/resolver.mjs";
var __vite_injected_original_dirname = "D:\\workerspace\\storlead-center-platform\\storlead-centre-platform\\ui\\sp-user-center\\vite\\plugins";
var auto_import_default = (path3) => {
  return AutoImport({
    // 自动导入 Vue 相关函数
    imports: ["vue", "vue-router", "@vueuse/core", "pinia"],
    eslintrc: {
      enabled: false,
      filepath: "./.eslintrc-auto-import.json",
      globalsPropValue: true
    },
    resolvers: [
      // 自动导入 Element Plus 相关函数ElMessage, ElMessageBox... (带样式)
      ElementPlusResolver(),
      IconsResolver({
        prefix: "Icon"
      })
    ],
    vueTemplate: true,
    // 是否在 vue 模板中自动导入
    dts: path3.resolve(path3.resolve(__vite_injected_original_dirname, "../../src"), "types", "auto-imports.d.ts")
  });
};

// vite/plugins/components.ts
import Components from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unplugin-vue-components@0.2_dcf43dd46d08c85c0e81c672b3d3d6b0/node_modules/unplugin-vue-components/dist/vite.mjs";
import { ElementPlusResolver as ElementPlusResolver2 } from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unplugin-vue-components@0.2_dcf43dd46d08c85c0e81c672b3d3d6b0/node_modules/unplugin-vue-components/dist/resolvers.mjs";
import IconsResolver2 from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unplugin-icons@0.15.1_@vue+compiler-sfc@3.2.45/node_modules/unplugin-icons/dist/resolver.mjs";
var __vite_injected_original_dirname2 = "D:\\workerspace\\storlead-center-platform\\storlead-centre-platform\\ui\\sp-user-center\\vite\\plugins";
var components_default = (path3) => {
  return Components({
    resolvers: [
      // 自动导入 Element Plus 组件
      ElementPlusResolver2(),
      // 自动注册图标组件
      IconsResolver2({
        enabledCollections: ["ep"]
      })
    ],
    dts: path3.resolve(path3.resolve(__vite_injected_original_dirname2, "../../src"), "types", "components.d.ts")
  });
};

// vite/plugins/icons.ts
import Icons from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unplugin-icons@0.15.1_@vue+compiler-sfc@3.2.45/node_modules/unplugin-icons/dist/vite.mjs";
var icons_default = () => {
  return Icons({
    // 自动安装图标库
    autoInstall: true
  });
};

// vite/plugins/svg-icon.ts
import { createSvgIconsPlugin } from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_1e425dbd503475a00215c0d6ebc0fce6/node_modules/vite-plugin-svg-icons/dist/index.mjs";
var __vite_injected_original_dirname3 = "D:\\workerspace\\storlead-center-platform\\storlead-centre-platform\\ui\\sp-user-center\\vite\\plugins";
var svg_icon_default = (path3, isBuild) => {
  return createSvgIconsPlugin({
    // 指定需要缓存的图标文件夹
    iconDirs: [path3.resolve(path3.resolve(__vite_injected_original_dirname3, "../../src"), "assets/icons/svg")],
    // 指定symbolId格式
    symbolId: "icon-[dir]-[name]",
    svgoOptions: isBuild
  });
};

// vite/plugins/compression.ts
import compression from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/vite-plugin-compression@0.5_a413f9b79cde2a5175f10540e95c159a/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.ts
import setupExtend from "file:///D:/workerspace/storlead-center-platform/storlead-centre-platform/ui/sp-user-center/node_modules/.pnpm/unplugin-vue-setup-extend-plus@0.4.9/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js";
var setup_extend_default = () => {
  return setupExtend({});
};

// vite/plugins/index.ts
import path from "path";
var plugins_default = (viteEnv, isBuild = false) => {
  const vitePlusgins = [];
  vitePlusgins.push(vue());
  vitePlusgins.push(unocss_default());
  vitePlusgins.push(auto_import_default(path));
  vitePlusgins.push(components_default(path));
  vitePlusgins.push(createCompression(viteEnv));
  vitePlusgins.push(icons_default());
  vitePlusgins.push(svg_icon_default(path, isBuild));
  vitePlusgins.push(setup_extend_default());
  return vitePlusgins;
};

// vite.config.ts
import path2 from "path";
var __vite_injected_original_dirname4 = "D:\\workerspace\\storlead-center-platform\\storlead-centre-platform\\ui\\sp-user-center";
var vite_config_default = defineConfig(({ mode, command }) => {
  const env = loadEnv(mode, process.cwd());
  return {
    // 部署生产环境和开发环境下的URL。
    // 默认情况下，vite 会假设你的应用是被部署在一个域名的根路径上
    // 例如 如果应用被部署在一个子路径上，你就需要用这个选项指定这个子路径。例如，如果你的应用被部署在，则设置 baseUrl 为 /admin/。
    base: env.VITE_APP_CONTEXT_PATH,
    resolve: {
      alias: {
        "~": path2.resolve(__vite_injected_original_dirname4, "./"),
        "@": path2.resolve(__vite_injected_original_dirname4, "./src"),
        "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js"
      },
      extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"]
    },
    build: {
      chunkSizeWarningLimit: 1500
      // 将警告限制调整到 1000 kB
    },
    // https://cn.vitejs.dev/config/#resolve-extensions
    plugins: plugins_default(env, command === "build"),
    server: {
      // 允许IP访问
      host: "0.0.0.0",
      // 应用端口 (默认:3000)
      port: 8688,
      // 运行是否自动打开浏览器
      open: false,
      proxy: {
        /** 代理前缀为 /dev-api 的请求  */
        "/api/": {
          changeOrigin: true,
          // 接口地址
          target: mode === "dev67" ? "http://192.168.1.67:10020" : "http://localhost:10010",
          // target: 'http://192.168.1.193:18090',
          pathRewrite: {
            ["^" + env.VITE_APP_BASE_API]: ""
          }
        }
      }
    },
    css: {
      preprocessorOptions: {
        scss: {
          javascriptEnabled: true
        }
      },
      postcss: {
        plugins: [
          {
            postcssPlugin: "internal:charset-removal",
            AtRule: {
              charset: (atRule) => {
                if (atRule.name === "charset") {
                  atRule.remove();
                }
              }
            }
          }
        ]
      }
    },
    // 预编译
    optimizeDeps: {
      include: [
        "vue",
        "vue-router",
        "pinia",
        "axios",
        "@vueuse/core",
        "path-to-regexp",
        "echarts",
        "@wangeditor/editor",
        "@wangeditor/editor-for-vue",
        "vue-i18n",
        "@vueup/vue-quill",
        "@iconify/iconify",
        "element-plus/es/components/form/style/css",
        "element-plus/es/components/form-item/style/css",
        "element-plus/es/components/button/style/css",
        "element-plus/es/components/input/style/css",
        "element-plus/es/components/input-number/style/css",
        "element-plus/es/components/switch/style/css",
        "element-plus/es/components/upload/style/css",
        "element-plus/es/components/menu/style/css",
        "element-plus/es/components/col/style/css",
        "element-plus/es/components/icon/style/css",
        "element-plus/es/components/row/style/css",
        "element-plus/es/components/tag/style/css",
        "element-plus/es/components/dialog/style/css",
        "element-plus/es/components/loading/style/css",
        "element-plus/es/components/radio/style/css",
        "element-plus/es/components/radio-group/style/css",
        "element-plus/es/components/popover/style/css",
        "element-plus/es/components/scrollbar/style/css",
        "element-plus/es/components/tooltip/style/css",
        "element-plus/es/components/dropdown/style/css",
        "element-plus/es/components/dropdown-menu/style/css",
        "element-plus/es/components/dropdown-item/style/css",
        "element-plus/es/components/sub-menu/style/css",
        "element-plus/es/components/menu-item/style/css",
        "element-plus/es/components/divider/style/css",
        "element-plus/es/components/card/style/css",
        "element-plus/es/components/link/style/css",
        "element-plus/es/components/breadcrumb/style/css",
        "element-plus/es/components/breadcrumb-item/style/css",
        "element-plus/es/components/table/style/css",
        "element-plus/es/components/tree-select/style/css",
        "element-plus/es/components/table-column/style/css",
        "element-plus/es/components/select/style/css",
        "element-plus/es/components/option/style/css",
        "element-plus/es/components/pagination/style/css",
        "element-plus/es/components/tree/style/css",
        "element-plus/es/components/alert/style/css",
        "element-plus/es/components/checkbox/style/css",
        "element-plus/es/components/date-picker/style/css",
        "element-plus/es/components/transfer/style/css",
        "element-plus/es/components/tabs/style/css",
        "element-plus/es/components/image/style/css",
        "element-plus/es/components/tab-pane/style/css"
      ]
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,[encoded data, 26792 characters]
