DField SolutionsMérnöki stúdió · Budapest
Loading · Töltődik
Skip to content

Bundler tree-shaking (and when it lies)

Related service Website & online shop

DEFINITION

A bundler (esbuild, Rollup, Webpack, Turbopack) statically drops unused exports. It works when modules are ESM, exports are unreferenced, and side-effect annotations are correct (`sideEffects: false` in package.json). It lies when you consume CJS, use dynamic `require` / `import`, or the library leans on `import './polyfill'` patterns. Most 'I expected this bundle to be smaller' moments are this · inspect with `webpack-bundle-analyzer` or `source-map-explorer`.

RELATED TERMS06
  • SSR (Server-Side Rendering)

    HTML rendered by the server per-request, fresh for every user. Ideal for dynamic content (dashboards), but slower than SSG.

  • SSG (Static Site Generation)

    Pages are produced at build time as HTML and served from a CDN. Near-zero TTFB. DField's own site runs this way across 111+ pages.

  • ISR (Incremental Static Regeneration)

    SSG + timed regeneration: the HTML is static but regenerates on a schedule. Ideal for blog content · freshness with CDN speed.

  • Edge rendering

    Code runs at the CDN edge closest to the user (Cloudflare Workers, Vercel Edge). Dynamic responses with ~10–50 ms TTFB.

  • RSC (React Server Components)

    React components that run exclusively on the server and never ship to the browser. Result: less client-side JS and faster hydration.

  • LCP (Largest Contentful Paint)

    Time until the largest visible element paints. Google Core Web Vitals passes under 2.5s · we usually land marketing pages under 1s.

MENTIONED IN THE BLOG07