Webpack
ELI5 — The Vibe Check
Webpack is the OG bundler — the grumpy grandpa of the JavaScript build world. It can do literally everything, but configuring it feels like defusing a bomb. Extremely powerful, extremely confusing, but it ships your code.
Real Talk
Webpack is a static module bundler for JavaScript applications. It builds a dependency graph from one or more entry points and outputs optimized bundles. It is highly extensible via loaders (for transforming files) and plugins (for broader build tasks), but has a steep configuration curve.
Show Me The Code
// webpack.config.js
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{ test: /\.jsx?$/, use: 'babel-loader' }
]
}
}
When You'll Hear This
The Webpack config is 300 lines and nobody touches it.,Webpack's HMR made development so much faster.,We migrated from Webpack to Vite for the DX improvements.
Related Terms
Bundler
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...
esbuild
esbuild is a bundler written in Go (not JavaScript) which means it's absolutely unhinged fast — like 10-100x faster than other bundlers.
Hot Module Replacement (HMR)
HMR is the magic that makes your browser update instantly when you save a file — without refreshing the whole page and losing your app state.
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.