// vite.config.ts
import { defineConfig } from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/vite@5.4.8_@types+node@22.5.3_less@4.2.1/node_modules/vite/dist/node/index.js";
import vue from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/@vitejs+plugin-vue@5.1.4_vite@5.4.8_@types+node@22.5.3_less@4.2.1__vue@3.5.11_typescript@5.6.3_/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import { fileURLToPath, URL } from "url";
import AutoImport from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/unplugin-auto-import@0.18.3_@nuxt+kit@3.13.2_rollup@4.21.2_webpack-sources@3.2.3__@vueuse+cor_ct7nfw7obvg6oaanky5netyf4u/node_modules/unplugin-auto-import/dist/vite.js";
import { visualizer } from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/rollup-plugin-visualizer@5.12.0_rollup@4.21.2/node_modules/rollup-plugin-visualizer/dist/plugin/index.js";
import Components from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/unplugin-vue-components@0.27.4_@babel+parser@7.25.6_@nuxt+kit@3.13.2_rollup@4.21.2_webpack-so_yuxkh365t2exwvukyuvotdxtdq/node_modules/unplugin-vue-components/dist/vite.js";
import { AntDesignVueResolver } from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/unplugin-vue-components@0.27.4_@babel+parser@7.25.6_@nuxt+kit@3.13.2_rollup@4.21.2_webpack-so_yuxkh365t2exwvukyuvotdxtdq/node_modules/unplugin-vue-components/dist/resolvers.js";
import viteCompression from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/vite-plugin-compression@0.5.1_vite@5.4.8_@types+node@22.5.3_less@4.2.1_/node_modules/vite-plugin-compression/dist/index.mjs";
import vueJsx from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/@vitejs+plugin-vue-jsx@4.0.1_vite@5.4.8_@types+node@22.5.3_less@4.2.1__vue@3.5.11_typescript@5.6.3_/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs";
import vueDevTools from "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/node_modules/.pnpm/vite-plugin-vue-devtools@7.4.6_@nuxt+kit@3.13.2_rollup@4.21.2_webpack-sources@3.2.3__rollup@4_ryihblh2z2o3v2ncveuo4sj7xy/node_modules/vite-plugin-vue-devtools/dist/vite.mjs";
var __vite_injected_original_import_meta_url = "file:///E:/work_space/java-workspace/coding_hobby/ims/ims-front/vite.config.ts";
var vite_config_default = defineConfig(({ mode }) => {
  console.log(mode);
  return {
    resolve: {
      alias: {
        "@": fileURLToPath(new URL("./src", __vite_injected_original_import_meta_url))
      }
    },
    optimizeDeps: {
      include: ["@ant-design/icons-vue", "ant-design-vue"]
    },
    plugins: [
      vue(),
      vueJsx(),
      vueDevTools(),
      process.env.npm_lifecycle_event === "report" ? visualizer({ open: true, brotliSize: true, filename: "report.html" }) : null,
      viteCompression({
        threshold: 1024e3
        // 对大于 1mb 的文件进行压缩
      }),
      AutoImport({
        dts: "src/auto-imports.d.ts",
        imports: ["vue", "vue-router", "@vueuse/core"],
        eslintrc: {
          enabled: true,
          filepath: "./.eslintrc-auto-import.json",
          globalsPropValue: true
        }
      }),
      Components({
        dts: "src/components.d.ts",
        deep: true,
        dirs: ["src/components"],
        extensions: ["vue", "tsx"],
        resolvers: [
          AntDesignVueResolver({
            importStyle: false
          })
        ]
      })
    ],
    server: {
      open: true,
      proxy: {
        "/api": {
          // target: 'https://iot.riemann.tech/api/',
          target: "http://127.0.0.1:8888",
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, "")
        }
      }
    },
    esbuild: {
      drop: ["console", "debugger"]
      // 删除 所有的console 和 debugger
    },
    build: {
      chunkSizeWarningLimit: 1500,
      rollupOptions: {
        output: {
          //每个node_modules模块分成一个js文件
          manualChunks(id) {
            if (id.includes("node_modules")) {
              return id.toString().split("node_modules/")[1].split("/")[1].toString();
            }
          },
          // 用于从入口点创建的块的打包输出格式[name]表示文件名,[hash]表示该文件内容hash值
          entryFileNames: "assets/js/[name].[hash].js",
          // 用于命名代码拆分时创建的共享块的输出命名
          chunkFileNames: "assets/js/[name].[hash].js",
          // 用于输出静态资源的命名，[ext]表示文件扩展名
          assetFileNames: "assets/[ext]/[name].[hash].[ext]"
        }
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,[encoded data, 7236 characters]
