STATIC MODULE BUNDLER

Bundle the web.

webpack packs many modules into a few bundled assets. Code splitting allows for loading parts of the application on demand — designed for modern JavaScript apps.

35M+

weekly downloads

65K+

GitHub stars

11K+

plugins published

v5.107.1

current release

CONFIGURATION

Sensible defaults. Configurable when you need it.

A single config file is enough for most projects. Compose loaders to transform any input; reach for plugins when behavior is non-trivial.

// webpack.config.js
    const path = require('path');
    
    module.exports = {
      entry: './src/index.js',
      output: {
        filename: 'bundle.js',
        path: path.resolve(__dirname, 'dist')
      },
      mode: 'production'
    };
JavaScript

Loaders for any input

Through loaders, modules can be CommonJS, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS — and your custom stuff.

  • Zero-config for common setups
  • Tree-shaking out of the box
  • Hot Module Replacement
  • Long-term caching with content hashes

WHY WEBPACK

Built for serious applications.

The original module bundler. Used by Vercel, Shopify, GitHub, Microsoft, and most of the modern frontend stack.

Module Federation

Share code across separately-deployed applications at runtime. The micro-frontend pattern, done right.

Code splitting

Split bundles by route, by demand, or by vendor. Load what's needed, when it's needed.

Tree shaking

Static analysis of ES modules eliminates dead code in production builds — automatically.

Hot module replacement

Edit and see the result without losing application state. The fastest feedback loop in JavaScript tooling.

Persistent caching

v5's filesystem cache makes warm builds near-instant. Cold builds are 38% faster than v4 on large monorepos.

11,000+ plugins

The largest ecosystem in JavaScript tooling. If a build problem exists, there's a webpack plugin for it.

TRUSTED BY

Vercel
Shopify
GitHub
Microsoft
Netflix
Airbnb