From de73971c2c8aaea52e33b3f424feeebd0ca548f7 Mon Sep 17 00:00:00 2001 From: notyclaw Date: Sun, 29 Mar 2026 20:06:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20vite.config=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vite.config.js b/vite.config.js index f84223c..eb79506 100644 --- a/vite.config.js +++ b/vite.config.js @@ -11,10 +11,8 @@ export default defineConfig({ '/api': { target: 'http://localhost:3000', changeOrigin: true, - // 显式确保 Authorization header 被转发(Vite 默认会转发,此处明确声明以防被代理中间件清除) configure: (proxy) => { proxy.on('proxyReq', (proxyReq) => { - // 确保 Authorization header 被传递到后端 if (proxyReq.getHeader('authorization')) { proxyReq.setHeader('authorization', proxyReq.getHeader('authorization')) } @@ -22,5 +20,15 @@ export default defineConfig({ } } } + }, + build: { + rollupOptions: { + output: { + manualChunks: { + 'element-plus': ['element-plus'], + 'vendor': ['vue', 'vue-router', 'axios'] + } + } + } } })