Led a systematic performance audit across three enterprise Next.js codebases. Eliminated duplicate dependencies, introduced route and component-level code splitting, replaced heavy libraries with lightweight alternatives, and enforced WebP image optimisation.
Three separate enterprise Next.js apps had grown organically over two years, accumulating 3.2MB+ bundles, duplicate lodash installations at three different versions, and zero code splitting below the page level. Core Web Vitals scores were in the red, and the business was seeing measurable drop-off from slow load times.
Ran webpack-bundle-analyzer across all three apps, baselining every metric before touching a line of code. Resolved duplicate dependencies via pnpm dedupe, replaced moment.js with date-fns (94% smaller), swapped axios for native fetch, and introduced dynamic imports for chart libraries, map components, and rich-text editors. All images migrated to Next.js Image with WebP and lazy loading.
Total bundle weight dropped from 3.2MB to 1.85MB — a 42% reduction. LCP improved by an average of 2.1 seconds across all three apps. Google Search Console impressions increased 23% in the two months following deployment as Core Web Vitals scores moved from red to green.