From 2b835c0ba44163004eda165832eef96b69d4583b Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Thu, 3 Oct 2024 10:13:34 +0800 Subject: [PATCH] chore(modules/web/vite.config.js): remove console statement and replace depreted splitVendorChunkPlugin --- modules/web/vite.config.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/web/vite.config.js b/modules/web/vite.config.js index a25828f84..227560bda 100644 --- a/modules/web/vite.config.js +++ b/modules/web/vite.config.js @@ -1,5 +1,5 @@ import { fileURLToPath, URL } from "node:url"; -import { defineConfig, splitVendorChunkPlugin } from "vite"; +import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import Icons from "unplugin-icons/vite"; import IconsResolver from "unplugin-icons/resolver"; @@ -12,7 +12,6 @@ export default ({ mode }) => defineConfig({ plugins: [ vue(), - splitVendorChunkPlugin(), // index vendor打包 AutoImport({ imports: ["vue", "vue-router", "pinia"], include: [/\.[tj]sx?$/, /\.vue$/, /\.vue\?vue/, /\.md$/], @@ -52,4 +51,18 @@ export default ({ mode }) => "@utils": fileURLToPath(new URL("./src/utils/", import.meta.url)), }, }, + esbuild: { + drop: ["console"], + }, + build: { + rollupOptions: { + output: { + manualChunks: (id) => { + if (id.includes("node_modules")) { + return "vendor"; + } + }, + }, + }, + }, });