From adddb4515817d03ff0d7db469fa684c7c1490ee0 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Sun, 24 May 2026 08:19:28 +0700 Subject: [PATCH] build(frontend): vendor-chunk charts/pdf/tiptap/monaco MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stabilizes browser cache: changes in dashboard/knowledges/report code no longer invalidate the heavy vendor libs. Side effect: the catch-all (react|react-dom|react-router-dom) regex stopped swallowing @monaco-editor/react and @tiptap/react, so react-vendor drops 469→178 KB. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/vite.config.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 1b40833c..bfaa3f29 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -77,6 +77,18 @@ export default defineConfig(({ mode }) => { if (/[\\/]@xterm[\\/]/.test(id)) { return 'terminal'; } + if (/[\\/]recharts[\\/]/.test(id)) { + return 'charts'; + } + if (/[\\/]@react-pdf[\\/]/.test(id)) { + return 'pdf'; + } + if (/[\\/](monaco-editor|@monaco-editor[\\/]react)[\\/]/.test(id)) { + return 'monaco'; + } + if (/[\\/](@tiptap|tiptap-markdown|prosemirror-[a-z-]+)[\\/]/.test(id)) { + return 'tiptap'; + } if (/[\\/](react|react-dom|react-router-dom)[\\/]/.test(id)) { return 'react-vendor'; }