Skip to content

Performance: Large bundle size with recharts imported but unused on main page #97

@Mosas2000

Description

@Mosas2000

Summary

The recharts library is listed as a dependency and imported in three chart components. While these components are not currently rendered on the main page, if they were added, the entire recharts library would be pulled into the bundle.

Recommended Fix

  1. Use dynamic imports for chart components: const CategoryChart = dynamic(() => import('./CategoryChart'))
  2. Implement code splitting at the route level
  3. Consider lighter chart alternatives for simple visualizations
  4. Analyze bundle size with next/bundle-analyzer

Impact

Low - Does not affect current bundles since charts are not imported in pages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfrontendFrontend related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions