From 45486337e53057f1e75efde62dc0be18f6edee3e Mon Sep 17 00:00:00 2001 From: OBAZE SAMUEL OSHIOKE Date: Sun, 18 Oct 2026 19:23:51 +0100 Subject: [PATCH] feat(bundling): route-level code splitting for monaco/chartjs/yjs (#1341)\n\n- Add monaco, chartjs, yjs cacheGroups to webpack splitChunks config\n- Heavy editor/graphing/collab libs deferred into separate chunks\n- Enables first-load JS reduction via on-demand chunk loading\n\nCloses #1341 --- frontend/next.config.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/frontend/next.config.ts b/frontend/next.config.ts index b4d525c0..aab548d0 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -49,6 +49,25 @@ const nextConfig: NextConfig = { chunks: 'all', priority: 20, }, + // Issue #1341: Route-level code splitting – defer heavy editor/graphing/libs + monaco: { + test: /[\\/]node_modules[\\/](monaco-editor|@monaco-editor)[\\/]/, + name: 'monaco', + chunks: 'all', + priority: 25, + }, + chartjs: { + test: /[\\/]node_modules[\\/](chart\.js|Chart\.js)[\\/]/, + name: 'chartjs', + chunks: 'all', + priority: 25, + }, + yjs: { + test: /[\\/]node_modules[\\/](yjs|[\\/]@yjs)[\\/]/, + name: 'yjs', + chunks: 'all', + priority: 25, + }, common: { name: 'common', minChunks: 2,