webpack
Static module bundler for JavaScript
TLDR
SYNOPSIS
webpack [command] [entries...] [options]
DESCRIPTION
webpack is a static module bundler for modern JavaScript applications. It builds a dependency graph from entry points and bundles modules into optimized output files for browsers.
The CLI is provided by webpack-cli and wraps webpack's configuration options. Most options can be specified via command line or in webpack.config.js. CLI options override configuration file settings.
webpack supports code splitting, lazy loading, tree shaking, and various loaders and plugins for processing different file types (CSS, images, TypeScript, etc.).
PARAMETERS
build, bundle, b
Run webpack to bundle the project (default command).serve, server, s
Run webpack dev server.watch, w
Run webpack and watch for file changes.init, create, c
Initialize a new webpack project.info, i
Output information about your system.configtest, t
Validate a webpack configuration file.-c, --config file
Path to webpack configuration file.--config-name name
Name of the configuration to use.-m, --merge
Merge multiple configurations.--mode mode
Set mode: production, development, or none.-o, --output-path path
Output directory (absolute path).-w, --watch
Watch mode, rebuild on file change.--env value
Environment variables passed to config function.--stats preset
Stats output level: errors-only, minimal, normal, verbose.-v, --version
Display version information.-h, --help
Display help message.
CAVEATS
webpack-cli must be installed separately from webpack core (npm install webpack webpack-cli). The dev server (webpack serve) requires webpack-dev-server. Complex configurations are better maintained in config files rather than CLI arguments.
HISTORY
webpack was created by Tobias Koppers and first released in March 2012. It revolutionized JavaScript build tooling by introducing concepts like code splitting and hot module replacement. webpack 4 (2018) focused on zero-config defaults, and webpack 5 (2020) improved build performance and module federation. The CLI was separated into webpack-cli starting with webpack 4.

