export function frontendManualChunk(id = "") { if (!id.includes("node_modules")) { return undefined; } if (id.includes("reactflow") || id.includes("dagre")) { return "workflow-vendor"; } // Recharts is only reachable from the lazily loaded ResourceUsageChart. // Let Rollup keep it with that dynamic graph instead of promoting a // charts-vendor dependency into the application entry chunk. if (id.includes("recharts")) { return undefined; } // motion is only reachable from lazily loaded pages (WorkflowEditor, // Monitoring, Audit, Runs). Pinning it into a manual chunk promotes the // package plus hoisted react interop modules into the application entry // chunk via modulepreload. Let Rollup keep it inside the dynamic graph so // it is only fetched when one of those pages loads. if (id.includes("/motion/")) { return undefined; } if (id.includes("lucide-react")) { return "icons-vendor"; } if (id.includes("react-router-dom") || id.includes("/react-dom/") || id.includes("/react/")) { return "react-vendor"; } return undefined; }