How I use @next/bundle-analyzer to find and fix Next.js bundle size bloat
A step-by-step walkthrough of Next.js bundle size analysis and reduction: finding large imports, fixing vendor chunks, and trimming icon libraries.
Tag
Image optimisation in Next.js and Sanity — WebP/AVIF delivery, focal-point crops, LQIP blur, and eliminating CLS.
8 posts
A step-by-step walkthrough of Next.js bundle size analysis and reduction: finding large imports, fixing vendor chunks, and trimming icon libraries.
Using Sanity's auto=format with next/image correctly avoids double-encoding and wasted bytes. Here is the exact setup I use in production.
A practical walkthrough of Next.js bundle size analysis using @next/bundle-analyzer, with before/after numbers from a real project.
Learn when to use Sanity's auto=format image URL API vs next/image formats, how cache keys work, and how to keep payloads small.
Kill CLS on Sanity images for good. Pull metadata.dimensions into next/image sizes and aspect-ratio boxes — exact GROQ and component code.
Stop letting next/image crop faces out of your hero. Wire Sanity hotspot + crop coordinates into next/image objectPosition — with code and the exact GROQ.
How I pre-calculate Sanity image hot-spot crops at build time to eliminate layout shift and guarantee stable LCP under 2.5s on editorial pages.
Cut LQIP overhead on Sanity + Next.js sites from 48 kB to under 5 kB. The production pattern, with the exact GROQ and Image component code.