Skip to content

Commit f8e22cf

Browse files
committed
docs: update CLI options & commands
1 parent 5a6a70b commit f8e22cf

File tree

1 file changed

+37
-39
lines changed

1 file changed

+37
-39
lines changed

packages/webpack-cli/README.md

+37-39
Original file line numberDiff line numberDiff line change
@@ -63,53 +63,51 @@ npx webpack-cli --help verbose
6363
### Available Commands
6464

6565
```
66-
build|bundle|b [entries...] [options] Run webpack (default command, can be omitted).
67-
configtest|t [config-path] Validate a webpack configuration.
68-
help|h [command] [option] Display help for commands and options.
69-
info|i [options] Outputs information about your system.
70-
init|create|new|c|n [generation-path] [options] Initialize a new webpack project.
71-
loader|l [output-path] [options] Scaffold a loader.
72-
plugin|p [output-path] [options] Scaffold a plugin.
73-
serve|server|s [entries...] [options] Run the webpack dev server.
74-
version|v [commands...] Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
75-
watch|w [entries...] [options] Run webpack and watch for files changes.
66+
build|bundle|b [entries...] [options] Run webpack (default command, can be omitted).
67+
configtest|t [config-path] Validate a webpack configuration.
68+
help|h [command] [option] Display help for commands and options.
69+
info|i [options] Outputs information about your system.
70+
serve|server|s [entries...] [options] Run the webpack dev server and watch for source file changes while serving.
71+
version|v [options] Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
72+
watch|w [entries...] [options] Run webpack and watch for files changes.
7673
```
7774

7875
### Available Options
7976

8077
```
8178
Options:
82-
-c, --config <value...> Provide path to a webpack configuration file e.g. ./webpack.config.js.
83-
--config-name <value...> Name of the configuration to use.
84-
-m, --merge Merge two or more configurations using 'webpack-merge'.
85-
--disable-interpret Disable interpret for loading the config file.
86-
--env <value...> Environment passed to the configuration when it is a function.
87-
--node-env <value> Sets process.env.NODE_ENV to the specified value.
88-
--define-process-env-node-env <value> Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`)
89-
--analyze It invokes webpack-bundle-analyzer plugin to get bundle information.
90-
--progress [value] Print compilation progress during build.
91-
-j, --json [value] Prints result as JSON or store it in a file.
92-
--fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack
93-
-d, --devtool <value> A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
94-
--no-devtool Negative 'devtool' option.
95-
--entry <value...> A module that is loaded upon startup. Only the last one is exported.
96-
--mode <value> Enable production optimizations or development hints.
97-
--name <value> Name of the configuration. Used when loading multiple configurations.
98-
-o, --output-path <value> The output directory as **absolute path** (required).
99-
--stats [value] Stats options object or preset name.
100-
--no-stats Negative 'stats' option.
101-
-t, --target <value...> Environment to build for. Environment to build for. An array of environments to build for all of them when possible.
102-
--no-target Negative 'target' option.
103-
-w, --watch Enter watch mode, which rebuilds on file change.
104-
--no-watch Negative 'watch' option.
105-
--watch-options-stdin Stop watching when stdin stream has ended.
106-
--no-watch-options-stdin Negative 'watch-options-stdin' option.
79+
-c, --config <pathToConfigFile...> Provide path to one or more webpack configuration files to process, e.g. "./webpack.config.js".
80+
--config-name <name...> Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations.
81+
-m, --merge Merge two or more configurations using 'webpack-merge'.
82+
--disable-interpret Disable interpret for loading the config file.
83+
--env <value...> Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval".
84+
--node-env <value> Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead)
85+
--config-node-env <value> Sets process.env.NODE_ENV to the specified value for access within the configuration.
86+
--analyze It invokes webpack-bundle-analyzer plugin to get bundle information.
87+
--progress [value] Print compilation progress during build.
88+
-j, --json [pathToJsonFile] Prints result as JSON or store it in a file.
89+
--fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack.
90+
-d, --devtool <value> A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
91+
--no-devtool Negative 'devtool' option.
92+
--entry <value...> A module that is loaded upon startup. Only the last one is exported.
93+
-e, --extends <value...> Path to the configuration to be extended (only works when using webpack-cli).
94+
--mode <value> Enable production optimizations or development hints.
95+
--name <value> Name of the configuration. Used when loading multiple configurations.
96+
-o, --output-path <value> The output directory as **absolute path** (required).
97+
--stats [value] Stats options object or preset name.
98+
--no-stats Negative 'stats' option.
99+
-t, --target <value...> Environment to build for. Environment to build for. An array of environments to build for all of them when possible.
100+
--no-target Negative 'target' option.
101+
-w, --watch Enter watch mode, which rebuilds on file change.
102+
--no-watch Negative 'watch' option.
103+
--watch-options-stdin Stop watching when stdin stream has ended.
104+
--no-watch-options-stdin Negative 'watch-options-stdin' option.
107105
108106
Global options:
109-
--color Enable colors on console.
110-
--no-color Disable colors on console.
111-
-v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
112-
-h, --help [verbose] Display help for commands and options.
107+
--color Enable colors on console.
108+
--no-color Disable colors on console.
109+
-v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
110+
-h, --help [verbose] Display help for commands and options.
113111
```
114112

115113
Checkout [`OPTIONS.md`](https://github.com/webpack/webpack-cli/blob/master/OPTIONS.md) to see list of all available options.

0 commit comments

Comments
 (0)