When Vite’s production build produces unexpectedly large bundles, the culprit is often esbuild’s minification and tree‑shaking logic. This guide walks through the common causes, step‑by‑step checks, and fixes to restore lean outputs.
A step‑by‑step guide to configuring Rollup for reliable tree‑shaking and custom chunk splitting, including sideEffects declaration, manualChunks strategy, and verification with rollup-plugin-visualizer.
Why import the entire D3 library when you only need scale and axis? This walkthrough shows how cherry-picking ES modules cuts bundle size, enables tree-shaking, and what to watch out for during migration.
A diagnostic guide to detect, analyze, and fix excessive Lodash bundle size caused by import patterns that defeat tree-shaking in webpack, Rollup, and Vite.
Vuetify 3's ES‑module exports let you import only the components you need, cutting the library's gzipped footprint from ~350 KB to under 80 KB. This post shows the import pattern, bundler settings, and a quick verification script.
Learn how to enable Rollup’s tree shaking to drop unused ES‑module exports, verify the size reduction, and handle common pitfalls like side‑effects and dynamic imports.
Chart.js v3+ lets you import only the controllers, scales, and elements you need. Explicit registration via Chart.register() cuts a typical line chart bundle from ~80 kB to ~18 kB gzipped. This post shows the pattern, a Vite+TS worked example, and the runtime gotchas to watch for.
Configure Rollup with format es and preserveModules true to emit a directory of ES files that mirrors your source, enabling downstream tree‑shaking without bundling the whole library.