webpack-cli

The official command-line interface for webpack, adding build, watch, serve, and config-validation commands to any project.

Tool
npm
v7.2.3
2,620 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
93 /100 Excellent
Development Activity 96
Maintenance 96
Community 80
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
80 /100 Excellent
Architecture 78
Code Quality 90
Innovation 85
Learning Curve 65

webpack-cli is the official command-line tool for webpack, giving developers a full set of commands — build, serve, watch, configtest, info, and version — for driving a webpack configuration from the terminal instead of writing custom Node scripts. It resolves and validates webpack config files written in JavaScript, TypeScript, JSON5, YAML, or TOML, delegates automatically to a locally installed webpack-cli so global and local installs never conflict, and exposes an extension point (CLIPlugin) that lets other webpack plugins register their own commands and options.

Beyond the base CLI, the monorepo also ships create-webpack-app, an interactive scaffolding tool for bootstrapping new webpack projects. Maintained as part of the core webpack organization, webpack-cli is the default entry point that the vast majority of webpack-based projects use to invoke webpack, whether directly from the terminal or through a framework’s own build scripts.

What You Get

  • Full command set — build, serve, watch, configtest, info, version, help, and complete — covering the entire webpack development lifecycle from one CLI.
  • Automatic config-format support for .js, .ts, .mjs, .cjs, .json5, .yaml, and .toml webpack configuration files, loading optional parsers only when needed.
  • Local-install delegation via import-local, so a globally installed webpack-cli automatically defers to a project’s own local version to avoid version drift.
  • Shell completion for zsh, bash, fish, and PowerShell driven by webpack’s own command schema.
  • A CLIPlugin extension point that lets webpack plugins register additional CLI commands and options.

Common Use Cases

  • Running webpack builds and dev servers from package.json scripts without hand-rolling a Node build script.
  • Validating a webpack configuration file in CI with configtest before a real build runs.
  • Scaffolding a brand-new webpack project with create-webpack-app’s interactive prompts.
  • Debugging environment-specific build issues using the info command’s environment report.

Under The Hood

Architecture

The CLI is centered on a single orchestrator class (WebpackCLI in packages/webpack-cli/src/webpack-cli.ts, backed by Commander.js for argument parsing) that lazily loads each command’s implementation on demand through #loadCommandByName rather than registering all commands and their ~850 combined options upfront. Non-JS configuration formats (JSON5/YAML/TOML) are handled by a small DATA_FORMAT_LOADERS table that imports the matching parser package from the user’s own project only when that format is actually used, and a dedicated ConfigurationLoadingError class carries structured failure info back to the top-level error handler. A CLIPlugin extension point lets external webpack plugins register additional commands, giving the CLI a degree of pluggable, event-driven extensibility layered on top of what is otherwise a monolithic command dispatcher.

Tech Stack

Written in strict TypeScript (ES2022 target, NodeNext module resolution) and built with tsc --build across an npm-workspaces monorepo (packages/webpack-cli and packages/create-webpack-app). Core dependencies are Commander for CLI parsing, webpack-merge for config merging, cross-spawn, envinfo for the info command, import-local for local-install delegation, interpret/rechoir for loading arbitrary config file types, and @discoveryjs/json-ext for streaming large stats output. Shell completion is provided by the optional @bomb.sh/tab peer dependency. Releases are versioned and published via Changesets, with pkg-pr-new providing per-PR preview publishes.

Code Quality

The test suite spans over a dozen categories (build, serve, watch, configtest, complete, info, version, help, api, external-command, create-webpack-app, and more) run with Jest through @swc/jest, exercising the CLI end-to-end against real fixture configs rather than only mocking internals. Linting combines eslint-config-webpack with cspell spellchecking, enforced through lint-staged and Husky pre-commit hooks, and formatting is standardized with Prettier. CI runs on GitHub Actions (nodejs.yml) alongside a dependency-review workflow, and the codebase leans on strict TypeScript typing and dedicated error classes rather than ad hoc error objects.

API Design The CLI’s public surface is its command set (build/bundle/b, serve/s, watch/w, configtest/t, info/i, version/v, help/h, complete), with short aliases for the most common commands and consistent, documented exit codes (0 success, 1 webpack error, 2 CLI/config error). Optional peer dependencies (js-yaml, json5, toml, @bomb.sh/tab, webpack-bundle-analyzer, webpack-dev-server) are pulled in lazily so the base install stays light, and import-local delegation means a single global install can transparently proxy to whichever local version a project depends on.

Used by 72 apps in this directory

TypeScript
71%
Other

highlight.io

Analytics · Developer Tools · Monitoring

9,384

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
76
Repo Health
78
Technical
65
Dependency
Built with
TypeScript 71%
Go 16%
Updated 6 days ago
TypeScript
62%
EPL-2.0

Huly Platform

Collaboration · Project Management · Team Chat

27,978

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
62
Dependency
Built with
TypeScript 62%
Svelte 34%
Updated 6 days ago
TypeScript
98%
MIT

isoflow

Design Tools · Developer Tools

1,728

A React component that lets developers embed a fully-featured, isometric network diagram editor directly into their applications.

View details
41
Repo Health
72
Technical
70
Dependency
Built with
TypeScript 98%
Updated 1 years ago
TypeScript
73%
Apache 2.0

Jitsi Meet

Collaboration · Team Chat · Video Conferencing

30,130

Open-source, end-to-end encrypted video conferencing you can self-host or embed into any web or mobile app.

View details
96
Repo Health
85
Technical
67
Dependency
Built with
TypeScript 73%
Lua 11%
JavaScript 10%
Updated 6 days ago
TypeScript
77%
Other

Joplin

Note Taking

56,853

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
60
Dependency
Built with
TypeScript 77%
JavaScript 14%
Updated 6 days ago
Python
64%
Other

Keep

Automation · Devops · Monitoring

12,433

The open-source AIOps and alert management platform that unifies 130+ monitoring tools into a single pane of glass with AI-powered correlation, deduplication, and workflow automation.

View details
88
Repo Health
79
Technical
66
Dependency
Built with
Python 64%
TypeScript 36%
Updated 1 weeks ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,338

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated 5 days ago
PHP
87%
AGPL 3.0

Kimai

Invoicing Finance · Project Management

5,095

Professional open-source time tracking with invoicing, multi-user support, SAML/LDAP auth, and a full REST API—self-host it or use the cloud.

View details
94
Repo Health
78
Technical
64
Dependency
Built with
PHP 87%
Updated 5 days ago
TypeScript
39%
Apache 2.0

Label Studio

AI Development · Data Engineering

28,540

Label Studio is an open-source, multi-type data labeling platform that lets teams annotate images, text, audio, video, and time series data with a configurable XML-based UI and export annotations in formats ready for any ML framework.

View details
93
Repo Health
87
Technical
64
Dependency
Built with
TypeScript 39%
JavaScript 27%
Python 25%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers