MCPcopy Create free account
hub / github.com/webpack/webpack-cli

github.com/webpack/webpack-cli

Chat with this repo
repository ↗ · DeepWiki ↗ · release webpack-cli@7.2.3 ↗ · + Follow · compare 4 versions
223 symbols 545 edges 151 files ⚖ MIT 14 documented · 6% updated 4d agowebpack-cli@7.2.3 · 2026-08-28★ 2,6173 open issues

Browse by type

Functions 183 Types & classes 40
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<a href="https://github.com/webpack/webpack-cli">
    <img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
</a>

webpack CLI

The official Command Line Interface of webpack

npm Build Status codecov Install Size GitHub Discussions Discord

Table of Contents

Introduction

Webpack CLI provides the interface of options webpack uses in its configuration file. The CLI options override options passed in the configuration file.

The CLI provides a rich set of commands that helps you develop your application faster.

How to install

If you have followed the Getting Started guide of webpack then webpack CLI is already installed!

Otherwise npm install --save-dev webpack-cli, yarn add webpack-cli --dev or pnpm add --D webpack-cli will install it.

Supported arguments and commands

Get to know what are the available commands and arguments here.

Packages

The main CLI logic using options, resides in packages/webpack-cli.

A summary of supported commands is described below.

Commands

Supporting developers is an important task for webpack CLI. Thus, webpack CLI provides different commands for many common tasks.

Getting started

If you have followed the Getting Started guide of webpack, then webpack CLI is already installed!

Otherwise, you would need to install webpack CLI and the packages you want to use.

If you want to create a fresh webpack project run the command as stated below:

npx create-webpack-app init

You will then be prompted for some questions about which features you want to use, such as scss, typescript, PWA support or other features.

Exit codes and their meanings

Exit Code Description
0 Success
1 Errors from webpack
2 Configuration/options problem or an internal error

Contributing and Internal Documentation

The webpack family welcomes any contributor, small or big. We are happy to elaborate, guide you through the source code and find issues you might want to work on! To get started have a look at our contribution documentation.

Funding

If you like webpack, please consider donating through Open Collective to help us keep the project relevant.

Code of Conduct

Guidelines to how the webpack organization expects you to behave is documented under Code of Conduct

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 93
Method 90
Interface 28
Class 12

Languages

TypeScript100%

Modules by API surface

packages/webpack-cli/src/webpack-cli.ts101 symbols
test/utils/test-utils.js20 symbols
packages/webpack-cli/src/plugins/cli-plugin.ts10 symbols
packages/create-webpack-app/src/utils/generate-files.ts9 symbols
smoketests/missing-packages/webpack.test.js8 symbols
packages/create-webpack-app/src/types.ts7 symbols
smoketests/helpers.js6 symbols
test/watch/watch-variable/webpack.config.js4 symbols
test/utils/webpack-cli-test-plugin.js4 symbols
test/serve/serve-variable/webpack.config.js4 symbols
test/create-webpack-app/test.utils.js4 symbols
test/create-webpack-app/init/generators.test.js4 symbols

Dependencies from manifests, versioned

@babel/core8.0.1 · 1×
@babel/preset-env8.0.2 · 1×
@babel/register8.0.1 · 1×
@changesets/cli3.0.1 · 1×
@changesets/get-github-info1.0.0 · 1×
@discoveryjs/json-ext1.1.0 · 1×
@inquirer/expand5.1.3 · 1×
@inquirer/select5.2.3 · 1×
@swc/core1.16.1 · 1×
@swc/jest0.2.39 · 1×
@types/cross-spawn6.0.6 · 1×
@types/ejs3.1.5 · 1×

For agents

$ claude mcp add webpack-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page