Skip to content

Code splitting to reduce bundle size #138

@spydmobile

Description

@spydmobile

The frontend builds into a single 2.1 MB JS chunk (dist/assets/index-*.js), well above Vite's 500 KB warning threshold.

Primary contributors:

  • MapBox GL JS (~800KB-1MB minified)
  • React + full application code in one bundle

Recommended approach:

  • Lazy-load routes/features with dynamic import()
  • Use build.rollupOptions.output.manualChunks to split vendor libs (MapBox, React) from app code
  • Consider lazy-loading MapBox GL only when the map view is active

Priority: Low — optimization task, not a bug. Appropriate when approaching production deployment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions