Bundler
ELI5 — The Vibe Check
A bundler is the robot that smashes all your separate JavaScript files, CSS, images, and random imports into one (or a few) neat packages that the browser can actually digest. It's basically a food processor for your code.
Real Talk
A bundler is a build tool that resolves a dependency graph starting from entry points, transforms source files (transpiling, compiling), and emits optimized output bundles for the browser. Popular bundlers include Webpack, Vite, Rollup, and esbuild.
Show Me The Code
// vite.config.js — configuring a bundler
export default {
build: {
rollupOptions: {
input: 'src/main.js',
output: { dir: 'dist' }
}
}
}
When You'll Hear This
Which bundler does this project use?,The bundler threw an error on the circular dependency.,Switching bundlers cut our build time in half.
Related Terms
Bundle
Imagine your code is a pile of LEGO instructions split across 50 tiny papers.
esbuild
esbuild is a bundler written in Go (not JavaScript) which means it's absolutely unhinged fast — like 10-100x faster than other bundlers.
Rollup
Rollup is the bundler you use when you're building a library rather than an app.
Vite
Vite is what happens when someone got sick of waiting 30 seconds for Webpack to start.
Webpack
Webpack is the OG bundler — the grumpy grandpa of the JavaScript build world.