chore(modules/web/vite.config.js): remove console statement and replace depreted splitVendorChunkPlugin

This commit is contained in:
Xwite 2024-10-03 10:13:34 +08:00
parent 8c268e4f59
commit 2b835c0ba4

View File

@ -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";
}
},
},
},
},
});