UI: code-split large chunks to reduce bundle size #78

Closed
opened 2026-03-17 16:41:08 +01:00 by claude · 0 comments
Owner

The Vite build warns about chunks larger than 500 KB after minification:

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application

The main offender is SwaggerPage (~1.3 MB), which is already lazy-loaded but still produces a large chunk. The new admin pages add further to the overall bundle.

Suggested approach:

  • Verify all admin pages use lazy() imports (they should already)
  • Consider lazy-loading heavy dependencies within pages (e.g., JSON viewers, diagram renderers)
  • Review build.rolldownOptions.output.codeSplitting for better automatic chunking
  • Optionally raise build.chunkSizeWarningLimit if the current sizes are acceptable for the use case
The Vite build warns about chunks larger than 500 KB after minification: ``` (!) Some chunks are larger than 500 kB after minification. Consider: - Using dynamic import() to code-split the application ``` The main offender is `SwaggerPage` (~1.3 MB), which is already lazy-loaded but still produces a large chunk. The new admin pages add further to the overall bundle. **Suggested approach:** - Verify all admin pages use `lazy()` imports (they should already) - Consider lazy-loading heavy dependencies within pages (e.g., JSON viewers, diagram renderers) - Review `build.rolldownOptions.output.codeSplitting` for better automatic chunking - Optionally raise `build.chunkSizeWarningLimit` if the current sizes are acceptable for the use case
Sign in to join this conversation.