Webpack Bundle Size Estimator
Estimate your JavaScript bundle size before you build. Add npm packages, toggle tree-shaking and partial imports, and see total gzipped weight with load time estimates across network speeds.
Frequently Asked Questions
How accurate are these bundle size estimates?▼
Sizes come from bundlephobia.com which measures the actual minified + gzipped output for each package. The tree-shaking and partial import savings are approximations (40% and 70% reduction respectively) — actual savings depend on your webpack/rollup config, which parts you import, and whether the library is written as ESM. Use these as planning estimates, not exact figures.
What is tree-shaking and does it work for all packages?▼
Tree-shaking is dead-code elimination — your bundler removes exports you never import. It only works on ESM (ES Modules) packages with a module field in package.json. Packages like moment, jquery, and most CJS-only packages cannot be tree-shaken. Lodash-es (the ESM version of lodash) is fully tree-shakeable; lodash (CJS) is not.
What does 'partial import' mean in this tool?▼
Partial import means you only import specific functions, not the entire library. For example, import format from 'date-fns/format' instead of import { format } from 'date-fns'. This is especially effective for large utility libraries like lodash, date-fns, and Material UI where you may only use 5-10% of the API surface.
How should I interpret the load time estimates?▼
These estimates assume the JS must be downloaded from scratch (no cache). Real-world load time depends on CDN caching (repeat visitors get cached bundles), HTTP/2 multiplexing, and how the JS is chunked. Focus on the 3G estimate as a worst-case mobile scenario — if it is over 5 seconds, consider code-splitting.
What is webpack-bundle-analyzer and how do I use it?▼
webpack-bundle-analyzer generates a visual treemap of your actual bundle. Install it: npm install --save-dev webpack-bundle-analyzer. Add to webpack.config.js: const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin. Then add new BundleAnalyzerPlugin() to your plugins array. Run webpack to open the visual report showing exactly which packages take the most space.
How do I reduce my JavaScript bundle size?▼
1. Code-split with dynamic import() so each route only loads what it needs. 2. Replace heavy libraries with lightweight alternatives (moment→dayjs, lodash→lodash-es, MUI→shadcn/radix). 3. Use partial imports for utility libraries. 4. Enable tree-shaking (ESM-only packages). 5. Use a CDN for large stable dependencies. 6. Audit with webpack-bundle-analyzer to find duplicate packages.
Related Products
on GumroadTypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →DevToolkit Starter Kit
A ready-to-deploy developer tools website with 12 built-in tools. Astro + Preact + Tailwind. Deploy to Cloudflare Pages for free. Built-in SEO, dark mode, and ad-ready layout.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
npm Package Stats
Look up npm package weekly download counts, unpacked size, dependency count, latest version, license, and repository link. Live data from the npm registry.
Open free tool →
pnpm Workspace Generator
GUI to configure a pnpm monorepo workspace with package globs, catalog entries, overrides, and options. Generates a ready-to-use pnpm-workspace.yaml file.
Open free tool →
NPM Bundle Size Estimator
Check npm package bundle sizes — minified and gzip. Enter multiple packages at once, see tree-shaking info, and compare sizes side by side.
Open free tool →
More Free Tools
Related Articles
Vite 6 vs Webpack 5 深度對決:2026 大型專案遷移實戰指南
2026 年最完整的 Vite 6 vs Webpack 5 深度比較與遷移指南。涵蓋效能基準測試、分塊策略、CSS Modules、環境變數轉換、常見陷阱與真實大型專案遷移清單。
Performance Optimization 2026: Complete Guide to Frontend, Backend, and Infrastructure
Comprehensive performance optimization guide for 2026 covering Core Web Vitals, JavaScript bundle optimization, server-side rendering, caching strategies, database query optimization, CDN configuration, and real-world benchmarks.
esbuild: The Fastest JavaScript Bundler - Complete Guide 2026
A complete guide to esbuild: configuration, plugins, benchmarks vs webpack and Vite, migration guide, and real-world usage patterns. Why esbuild is the fastest JavaScript bundler.
pnpm vs npm vs yarn: Package Manager Performance Benchmark 2026
Real benchmarks comparing pnpm, npm, and yarn in 2026 — install speed, disk usage, monorepo support, lockfile format, and which to choose for your JavaScript project.
Rspack vs Webpack 5: Rust-Powered Bundling Speed in 2026
Deep dive into Rspack vs Webpack 5 in 2026. Performance benchmarks (5-10x faster), webpack plugin compatibility, migration guide, and when to switch to the Rust-powered bundler from ByteDance.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →