Menu

1 / 2

One "import * as Icons" line was shipping 5,727 icons to every visitor of our Next.js site

DEV Community: javascript·Oliver K.·14 days ago
#c4krsaIN
#devtojavascript#devto#dev#icons#import
Long article (1920 words) — no AI summary yet.
Reading 0:00
15s threshold

I look after the marketing site for Fashio , a small product that generates on-model photos and virtual try-ons for fashion e-commerce. The site is a Next.js 16 App Router project: mostly Server Components, markdown content with YAML frontmatter, 24 locales, and a handful of "use client" components for menus and interactive bits.

In August I was doing an accessibility pass and noticed the homepage was shipping roughly 2 MB of JavaScript . For a page that is mostly text, images and a mega-menu, that is absurd. This post is about where that weight came from, how I found it, and the two fixes that took the homepage from 1995 KB to 676 KB of JS.

Neither cause showed up in Lighthouse.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.