Web Dev Academy Build tools · Webpack, Rollup, esbuild… Tool 56 / 64
Build tools

Webpack, Rollup, esbuild…

Bundlers. They follow your imports, gather hundreds of source files into a handful of optimised, minified files, and shrink them so browsers download less and load faster.

Demo 01

Many source files → one optimised bundle

A bundler starts at your entry file, walks every import, and merges the whole dependency graph into one (or a few) output files. Then it minifies — strips whitespace, shortens variable names and removes dead code. Press build and watch it happen.

index.js
app.js
router.js
store.js
styles.css
utils.js
api.js
logo.svg
bundle.js
8 modules · not built yet
Raw (sum)
— KB
Minified + gzip
— KB
Demo 02

Bundler speed: esbuild changed the game

Classic JS-based bundlers parse and transform every module in JavaScript. esbuild (Go) and newer Rust tools (Turbopack, SWC) do it with compiled, parallel code — often 10–100× faster. Race a typical production build.

webpack
Rollup
esbuild
The line-up

Webpack · Rollup · esbuild · Parcel · Turbopack

Different tools, different trade-offs — but all answer the same question: how do I turn a tree of source files into something a browser loads fast?

Webpack veteran

The configurable workhorse. Huge plugin/loader ecosystem; powers countless legacy apps. Steepest config.

JavaScript

Rollup libraries

Clean ESM output and great tree-shaking — the choice for publishing libraries. Powers Vite's prod build.

JavaScript

esbuild speed

Written in Go. Blisteringly fast bundling & minification; used under the hood by Vite, tsup and more.

Go

Parcel zero-config

Point it at an HTML file and go — sensible defaults, no config required. Great for quick projects.

JS / Rust (SWC)

Turbopack next-gen

Rust-based successor to Webpack from the Next.js team, built for huge apps and incremental builds.

Rust
What "bundling" means

From imports to one file

You write small, focused modules and import between them. The bundler resolves that graph, concatenates and transforms it, and emits output the browser can load in one request — with tree-shaking dropping anything you never use.

// src/index.js — your entry (human-readable)
import { render } from './app.js'
import { format } from './utils.js'
import './styles.css'

render(format('hello'))
/* dist/bundle.[hash].js — one minified output */
(()=>{var e={};function t(n){return n.trim()}
function r(n){document.body.textContent=n}r(t("hello"))})();
# typical commands
npx webpack --mode production
npx rollup -c
npx esbuild src/index.js --bundle --minify --outfile=dist/bundle.js
i
The “files → bundle” animation, the size-shrink bars and the speed race above are an interactive visual simulation built with vanilla JavaScript — the module count, KB figures and build times are dramatised, not measured. The real Webpack, Rollup, esbuild, Parcel and Turbopack run in your command line, where they walk your actual import graph and emit real optimised bundles. The shared CSS shell provides the page styling.

↑ All 64 tools