From 5c0cedd642d0726803e06a10a1e06c0f83c36a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?mac=C2=B7ufutx?= Date: Tue, 10 Jun 2025 17:18:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=2020250610=20=E8=87=AA=E5=8A=A8=E5=88=86?= =?UTF-8?q?=E5=8C=85=EF=BC=88=E5=88=A9=E7=94=A8=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E7=BC=93=E5=AD=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 9d713cc..fa9fe6a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -16,6 +16,18 @@ export default defineConfig({ svgo: { plugins: [{ name: 'removeViewBox' }] } }) ], + build: { + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes('node_modules')) { + // 将第三方库单独分包(如 axios、vue 等) + return id.split('node_modules/')[1].split('/')[0] + } + } + } + } + }, resolve: { alias: { '@': path.resolve(__dirname, 'src') // 添加路径别名