build(frontend): vendor-chunk charts/pdf/tiptap/monaco

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) <noreply@anthropic.com>
This commit is contained in:
Sergey Kozyrenko
2026-05-24 08:19:28 +07:00
co-authored by Claude Opus 4.7
parent 1ee2a6f7c9
commit adddb45158
+12
View File
@@ -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';
}