StackpineEmail us

Pineflow · Bundle size doubled with no obvious cause

← All fixes
Ship

Bundle size doubled with no obvious cause

Run `next build` and look at the route-level breakdown, it shows per-page kB. Then `npx @next/bundle-analyzer` for a visual. Usual culprits: a heavy lib imported in a layout (loads on every page), an icon set fully imported instead of tree-shaken, or accidentally bundling a server-only module into a client component.

Prompt to paste
Prompt
My Next.js bundle size jumped with no obvious cause. Show me how to read the route-level kB breakdown from next build and run the bundle analyzer, then help me find the culprit: a heavy lib imported in a layout, a non-tree-shaken icon set, or a server-only module pulled into a client component. Point at the import to change.