// vite.config.ts
import { defineConfig, loadEnv } from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/vite/dist/node/index.js";
import basicSsl from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/@vitejs/plugin-basic-ssl/dist/index.mjs";
import Icons2 from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-icons/dist/vite.js";
import IconsResolver3 from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-icons/dist/resolver.js";
import Components2 from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-vue-components/dist/vite.js";

// vite/plugins/index.ts
import vue from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/@vitejs/plugin-vue/dist/index.mjs";

// vite/plugins/unocss.ts
import UnoCss from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unocss/dist/vite.mjs";
var unocss_default = () => {
  return UnoCss({
    hmrTopLevelAwait: false
    // unocss默认是true，低版本浏览器是不支持的，启动后会报错
  });
};

// vite/plugins/auto-import.ts
import AutoImport from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-auto-import/dist/vite.js";
import { ElementPlusResolver } from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-vue-components/dist/resolvers.js";
import IconsResolver from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-icons/dist/resolver.js";
var __vite_injected_original_dirname = "/Users/ysg/Desktop/\u5F00\u53D1/mom\u5E73\u53F0/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:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-vue-components/dist/vite.js";
import { ElementPlusResolver as ElementPlusResolver2 } from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-vue-components/dist/resolvers.js";
import IconsResolver2 from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-icons/dist/resolver.js";
var __vite_injected_original_dirname2 = "/Users/ysg/Desktop/\u5F00\u53D1/mom\u5E73\u53F0/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:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-icons/dist/vite.js";
var icons_default = () => {
  return Icons({
    // 自动安装图标库
    autoInstall: true
  });
};

// vite/plugins/svg-icon.ts
import { createSvgIconsPlugin } from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/vite-plugin-svg-icons/dist/index.mjs";
var __vite_injected_original_dirname3 = "/Users/ysg/Desktop/\u5F00\u53D1/mom\u5E73\u53F0/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:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/vite-plugin-compression/dist/index.mjs";
var compression_default = (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:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js";
var setup_extend_default = () => {
  return setupExtend({});
};

// vite/plugins/i18n.ts
import VueI18nPlugin from "file:///Users/ysg/Desktop/%E5%BC%80%E5%8F%91/mom%E5%B9%B3%E5%8F%B0/node_modules/@intlify/unplugin-vue-i18n/lib/vite.mjs";
var __vite_injected_original_dirname4 = "/Users/ysg/Desktop/\u5F00\u53D1/mom\u5E73\u53F0/vite/plugins";
var i18n_default = (path3) => {
  return VueI18nPlugin({
    include: [path3.resolve(__vite_injected_original_dirname4, "../../src/lang/**.json")]
  });
};

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

// vite.config.ts
import path2 from "path";
var __vite_injected_original_dirname5 = "/Users/ysg/Desktop/\u5F00\u53D1/mom\u5E73\u53F0";
var vite_config_default = defineConfig(({ mode, command }) => {
  const env = loadEnv(mode, process.cwd());
  return {
    // 部署生产环境和开发环境下的URL。
    // 默认情况下，vite 会假设你的应用是被部署在一个域名的根路径上
    // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上，你就需要用这个选项指定这个子路径。例如，如果你的应用被部署在 https://www.ruoyi.vip/admin/，则设置 baseUrl 为 /admin/。
    base: env.VITE_APP_CONTEXT_PATH,
    resolve: {
      alias: {
        "~": path2.resolve(__vite_injected_original_dirname5, "./"),
        "@": path2.resolve(__vite_injected_original_dirname5, "src")
      },
      extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"]
    },
    // https://cn.vitejs.dev/config/#resolve-extensions
    plugins: [
      plugins_default(env, command === "build"),
      basicSsl(),
      Components2({
        resolvers: [
          IconsResolver3({
            compiler: "vue3"
          })
        ]
      }),
      Icons2({
        compiler: "vue3"
      })
    ],
    server: {
      host: "0.0.0.0",
      port: Number(env.VITE_APP_PORT),
      // https: true,
      open: true,
      proxy: {
        [env.VITE_APP_BASE_API]: {
          // target: 'http://localhost:6080',
          // target: 'https://frp-off.com:47543',
          // target: 'http://192.168.100.102:6080',
          // target: 'http://192.168.100.100:6080',
          // target: 'http://1.13.177.47:6080',
          target: "http://192.168.0.15:6080",
          changeOrigin: true,
          ws: true,
          rewrite: (path3) => path3.replace(new RegExp("^" + env.VITE_APP_BASE_API), "")
        },
        "/dev-api2": {
          target: "http://localhost:6082",
          changeOrigin: true,
          ws: true,
          rewrite: (path3) => path3.replace(new RegExp("^" + env.VITE_APP_BASE_API), "")
        },
        "/dev-api3": {
          target: "http://localhost:6083",
          changeOrigin: true,
          ws: true,
          secure: false,
          rewrite: (path3) => path3.replace(new RegExp("^" + env.VITE_APP_BASE_API), "")
        },
        "/deva-api": {
          target: `http://175.27.215.92/prod-api`,
          changeOrigin: true,
          ws: true,
          rewrite: (path3) => path3.replace(new RegExp("^/deva-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",
        "echarts",
        "vue-i18n",
        "@vueup/vue-quill",
        "bpmn-js/lib/Viewer",
        "bpmn-js/lib/Modeler.js",
        "bpmn-js-properties-panel",
        "min-dash",
        "diagram-js/lib/navigation/movecanvas",
        "diagram-js/lib/navigation/zoomscroll",
        "bpmn-js/lib/features/palette/PaletteProvider",
        "bpmn-js/lib/features/context-pad/ContextPadProvider",
        "diagram-js/lib/draw/BaseRenderer",
        "tiny-svg",
        "image-conversion",
        "element-plus/es/components/**/css"
      ]
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,[encoded data, 23224 characters]
