npm / webpack-cli
webpack-cli
What changed in webpack-cli 4 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
22 breaking5 new APIs and options4 performance11 behavior and defaults5 tooling11 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initwebpack-cli 727 changes
Breaking changes 4
This argument replaces the removed
--node-envargument.The minimum supported Node.js version is now 20.9.0.
The
--node-envargument was removed in favor of--config-node-env.The deprecated API was removed; users importing or requiring
webpack-cliasclimay need to change their usage.
New APIs and options 3
Adds shell completions for zsh, bash, fish, and powershell through this command.
In multi-compiler mode, this option makes each dev server serve only the compiler from its own configuration instead of serving all compilers by default.
Configuration files can now use JSON5, YAML or TOML; the corresponding parser package must be installed by the user.
Performance 4
Shares the compile cache with child processes and worker threads, such as minimizer workers, so they start warm too.
Enables the Node.js compile cache to speed up CLI startup; it is available on Node.js >= 22.8.0.
CLI startup uses less CPU and memory, so commands start more efficiently.
Performance improved.
Behavior and default changes 6
The help output now has branded headers, section dividers, colorized terms and a clearer footer; colors and chrome become plain text when output is piped or --no-color is used.
The file protocol is now supported for the --config and --extends configuration options.
Configuration freezing is now allowed.
The CLI uses graceful shutdown when file system cache is enabled.
The command now outputs versions only.
The CLI uses dynamic import to load the configuration, falling back to interpretation when dynamic import cannot load it; this allows use of Node.js's built-in TypeScript support.
Tooling 4
With webpack-dev-server@6, the CLI drives watch compilation, prints build stats, and closes the compiler on shutdown; older dev servers continue to manage their own compilation.
Allow toml@5 as a peer dependency for TOML configuration files.
tsx is used as a fallback loader for TypeScript and JSX configuration files when no loader known to interpret, such as ts-node, is installed.
webpack-dev-server v6 is now supported as an optional peer dependency, alongside v5.
Fixes and other changes 6
The CLI detects unavailable package managers and failed installations, choosing an installed alternative instead of npm when appropriate and stopping after an installation fails.
Dev servers for configurations that share the same object are assigned distinct ports.
Keeps this multi-compiler option set on a configuration array when
--config-nameorextendsrebuilds it.Resolve the webpack-dev-server type from its default export so the types work with both v5 and v6.
Fixes dynamic import interop for CLIPlugin under Bun.
Resolves the configuration path for cache build dependencies.
webpack-cli 614 changes
Breaking changes 8
The --define-process-env-node-env option was renamed to --config-node-env.
The CLI no longer serves when dev-server is false.
The init command was removed in favor of create-webpack-app.
The loader command was removed in favor of create-webpack-app.
The minimum required Node.js version is now 18.12.0.
The minimum supported webpack version is now 5.82.0.
The plugin command was removed in favor of create-webpack-app.
Support for webpack-dev-server v4 was dropped.
Behavior and default changes 4
Shutdown behavior was improved to shut down gracefully.
The info command now outputs the pnpm version.
The version command now outputs the pnpm version.
webpack.config.js can now be required in ESM format.
Tooling 1
Help output now better presents possible values.
Fixes and other changes 1
The minimum help output was corrected.
webpack-cli 513 changes
Breaking changes 9
Adds an option for setting process.env.NODE_ENV; it replaces --node-env.
The --entry option now adds a specified entry instead of replacing existing entries; use --entry-reset to restore the previous behavior.
Removes --hot for the build command in favor of using HotModuleReplacement directly; it continues to work for serve.
Removes the migrate command.
webpack-cli no longer supports webpack-dev-server v3; webpack-dev-server v4.0.0 is the minimum supported version.
webpack-cli no longer supports webpack v4; webpack v5.0.0 is the minimum supported version.
Removes --node-env in favor of --define-process-env-node-env.
Removes --prefetch in favor of the PrefetchPlugin plugin.
Removes the redundant utils export.
New APIs and options 2
Adds an option for preventing interpret.
Adds the failOnWarnings option.
Behavior and default changes 1
The minimum help output now shows all CLI-specific flags.
Fixes and other changes 1
webpack-cli now respects the NODE_PATH environment variable.
webpack-cli 44 changes
Breaking changes 1
Exits the process in case of schema errors.
Fixes and other changes 3
The CLI executor supplies arguments further up.
Fixes the exit code for validation errors.
Adds the compilation lifecycle in a watch instance.