Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

webpack

Module bundler that packages JavaScript, assets and dependencies for browser deployment.

Build tools and bundlersNPM

GitHubWebsite

1. License

License from npm.

github.com/webpack/webpack

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What webpack does

Webpack is a bundler that dates to 2012, and it can now take an HTML page as its entry and handle the page, its CSS and its scripts itself, through built-in support the README still calls experimental, while keeping the loader and plugin system it was built around.

webpack popularity

83 / 100
Gid Score, #61 overall
76.9M
downloads a week, npm
66K
GitHub stars
53
agent projects use it
webpack: downloads per weeknpm, webpack 76,909,237
webpack: GitHub starswebpack/webpack 66,018

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How webpack is used

  • webpack is a dependency in 53 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.1% of the 4,867 JavaScript/TypeScript ones), #18 of 185 in build tools and bundlers.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 328; those are left out of every share on this page.
  • The most used alternative in our scan is Vite (1,238 projects).
  • Projects that use it most often also use webpack CLI (62.3%), ESLint (77.4%), Babel (JavaScript) (35.8%).
  • It is more common in projects set up for Roo Code (4.5%) than for Claude Code (0.9%).

By coding agent

31 projects, 0.9%
27 projects, 0.9%
27 projects, 1.1%
9 projects, 1.9%
6 projects, 2.2%
5 projects, 4.5%

Often used with

In 62.3% of its projects
In 77.4% of its projects
In 35.8% of its projects
In 35.8% of its projects
In 30.2% of its projects
In 26.4% of its projects
In 32.1% of its projects
In 24.5% of its projects

webpack in practice

Strengths

An HTML page can be the entry

The website's quick start sets <code>entry</code> to <code>./src/index.html</code>. The site says webpack then bundles what the page references and rewrites the URLs, and adds: "No loader, no plugin."

One flag separates debug and deploy builds

The site says <code>--mode production</code> minifies the page, stylesheet and script and drops unused code. It says <code>--mode development</code> leaves output unminified and maps the bundle back to your source in devtools.

Loaders turn other files into modules

The README lists TypeScript to JavaScript, Handlebars strings to compiled functions and images to Base64 as examples. It also lists loaders for Sass, Less, PostCSS, Vue and Svelte.

Code splitting into async chunks

Output can be a single bundle or several chunks loaded on demand at runtime. The README gives reducing initial loading time as the reason.

Watch out for

Native HTML and CSS are experimental

The README calls the built-in HTML and CSS support experimental. It says CSS preprocessors and template engines still need their loaders.

Latest patch notes lean on HTML and CSS fixes

In the visible part of the notes for v5.111.1 (2026-09-18), many entries are fixes to HTML parsing and to the HTML and CSS minifiers.

Easy config mistakes

The docs warn that rules belong under <code>module.rules</code>, not a top-level <code>rules</code>. They also warn that a regex in <code>test</code> must not be quoted, because a quoted value matches a single file path.

Use an HTML page as the entry

export default {
  entry : "./src/index.html" ,
  output : {
    // the page loads a `<script type="module">`, so emit ES modules to match
    module : true ,
  } ,
} ;

More about webpack

Funding
  • Open Collective: https://opencollective.com/webpack

See all

Head to head
Packages around it
  • webpack-cli: Command-line runner
  • webpack-dev-server: Development server
  • phaser: HTML5 game framework
  • html-webpack-plugin: HTML page generation
  • babel-loader: Babel transpiling loader
  • @babel: JavaScript compiler
More in Build tools and bundlers

Alternatives

webpack This page

MITGid 8376.9M/wk

Vite

Fast native-ESM powered web development build tool and dev server.

MITGid 92288M/wk

esbuild

Extremely fast JavaScript and CSS bundler and minifier written in Go.

MITGid 85443M/wk

SWC

Super-fast Rust-based JavaScript compiler and bundler alternative to Babel.

Apache-2.0Gid 7861.9M/wk

tsup

Zero-config TypeScript library bundler powered by esbuild.

MITGid 7113.1M/wk

Compare webpack with another tool

Get started

Install it.

npm install webpack

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## webpack
- Install `webpack` and `webpack-cli` as dev dependencies. webpack-cli 7 requires Node.js 20.9.0 or later.
- Put loader rules under `module.rules`, never a top-level `rules`. Write `test` as an unquoted regex like `/\.js$/`, not a string.
- With no config file, the entry is `./src/index.js`. If that file is missing, webpack throws `Can't resolve './src'`. Add `webpack.config.js` with an `entry` to use another file.
- If `package.json` has no `"type": "module"`, write the config with `require(...)` and `module.exports` instead of `import` and `export default`.
- Create plugins with `new` inside the `plugins` array, for example `new webpack.ProgressPlugin()`.
- When the HTML entry loads a `<script type="module">`, set `output.module: true` so webpack emits ES modules.
- Set `mode` explicitly. It defaults to `production`; use `development` for unminified output with source mapping.