From 7f14c499ad61a7e74be638e5ca920c9951a3a01c Mon Sep 17 00:00:00 2001 From: c0mrade Date: Tue, 26 May 2026 15:12:50 +0300 Subject: [PATCH] perf(build): split recharts + tiptap into dedicated vendor chunks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, recharts (337 KB raw) lived inside an auto-generated shared chunk named after the small useChartColors hook because that hook was the first import path pulling recharts in. Any change to the hook busted the chunk hash and forced users to re-download the whole charting library. Same story for @tiptap and the prosemirror peers — they were grouped under a 'tiptap-video' chunk named after the local extension file. Explicit vendor-recharts and vendor-tiptap buckets give those libs stable cache-keys and predictable names that match the rest of the vendor-* chunking scheme. Bundle sizes are net-neutral; what improves is cache stability across releases. --- vite.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index eb6ae11..f0cb434 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -55,6 +55,10 @@ export default defineConfig({ if (id.includes('twemoji') || id.includes('@twemoji/')) return 'vendor-twemoji'; if (id.includes('/jsencrypt/') || id.includes('@kastov/')) return 'vendor-crypto'; if (id.includes('@lottiefiles/')) return 'vendor-lottie'; + // Heavy admin-only deps — split so they don't bloat the shared + // chunks of other lazy admin pages that don't use them. + if (id.includes('/recharts/') || id.includes('/d3-')) return 'vendor-recharts'; + if (id.includes('@tiptap/') || id.includes('/prosemirror-')) return 'vendor-tiptap'; if ( id.includes('/axios/') || id.includes('/zustand/') ||