From 4380a988f749341256962856d7a3c15ab6edee82 Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Fri, 15 Aug 2025 13:10:47 +0800 Subject: [PATCH] chore: split large vite chunks --- frontend_nuxt/nuxt.config.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/frontend_nuxt/nuxt.config.ts b/frontend_nuxt/nuxt.config.ts index 7c16e17fc..3c680c484 100644 --- a/frontend_nuxt/nuxt.config.ts +++ b/frontend_nuxt/nuxt.config.ts @@ -60,4 +60,27 @@ export default defineNuxtConfig({ isCustomElement: (tag) => ['l-hatch', 'l-hatch-spinner'].includes(tag), }, }, + vite: { + build: { + // increase warning limit and split large libraries into separate chunks + chunkSizeWarningLimit: 1024, + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes('node_modules')) { + if (id.includes('vditor')) { + return 'vditor' + } + if (id.includes('echarts')) { + return 'echarts' + } + if (id.includes('highlight.js')) { + return 'highlight' + } + } + }, + }, + }, + }, + }, })