fix(frontend): revert manualChunks grouping (regressed login payload)

The manualChunks config from the previous commit over-grouped Monaco
into a single `vendor-monaco` chunk. Any small utility touched by the
login page graph was enough to drag the full 6.5 MB Monaco bundle into
the initial preload, so the Cloudflare preview of the login page was
downloading ~7 MB while production downloads ~166 KB (a ~44x
regression).

Reverting the manualChunks function. Without it, Rollup's default
chunking splits Monaco fine-grainedly by usage pattern and the login
preload drops back to ~165 KB, matching production.

The OpenAI / Anthropic SDK dynamic-import refactor from the first
commit stays in place (it uses await import(...), which creates its
own chunks naturally and does not have this problem).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-04-24 13:11:48 +00:00
co-authored by Claude Opus 4.7
parent 7a9c7687f7
commit 90d82b2e84
-47
View File
@@ -111,53 +111,6 @@ const config = {
dedupe: ['vscode', 'monaco-editor']
},
assetsInclude: ['**/*.wasm'],
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('monaco-editor') || id.includes('@codingame/monaco-vscode')) {
return 'vendor-monaco'
}
if (id.includes('/openai/') || id.includes('/@anthropic-ai/')) {
return 'vendor-ai'
}
if (id.includes('@xyflow/svelte') || id.includes('d3-dag')) {
return 'vendor-flow'
}
if (id.includes('/yjs/') || id.includes('y-websocket') || id.includes('y-monaco')) {
return 'vendor-collab'
}
if (id.includes('ag-grid') || id.includes('ag-charts')) {
return 'vendor-ag'
}
if (id.includes('pdfjs-dist')) {
return 'vendor-pdf'
}
if (
id.includes('svelte-exmarkdown') ||
id.includes('/parse5/') ||
id.includes('/rehype-') ||
id.includes('/remark-') ||
id.includes('/mdast-') ||
id.includes('/micromark')
) {
return 'vendor-markdown'
}
if (id.includes('quicktype-core')) {
return 'vendor-quicktype'
}
if (id.includes('/quill/')) {
return 'vendor-quill'
}
if (id.includes('/chart.js/') || id.includes('chartjs-')) {
return 'vendor-chart'
}
}
}
}
}
},
test: {
expect: { requireAssertions: true },
projects: [