Skip to content

Commit 9d46b72

Browse files
authored
docs: add more information (#2683)
1 parent 0fc3eec commit 9d46b72

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

packages/webpack-cli/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,32 @@ Global options:
115115
### webpack 5
116116

117117
Checkout [`OPTIONS.md`](https://github.com/webpack/webpack-cli/blob/master/OPTIONS.md) to see list of all available options.
118+
119+
## Exit codes and their meanings
120+
121+
| Exit Code | Description |
122+
| --------- | -------------------------------------------------- |
123+
| `0` | Success |
124+
| `1` | Errors from webpack |
125+
| `2` | Configuration/options problem or an internal error |
126+
127+
## CLI Environment Variables
128+
129+
| Environment Variable | Description |
130+
| ----------------------------------- | ------------------------------------------------------------------- |
131+
| `WEBPACK_CLI_SKIP_IMPORT_LOCAL` | when `true` it will skip using the local instance of `webpack-cli`. |
132+
| `WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG` | when `true` it will force load the ESM config. |
133+
| `WEBPACK_PACKAGE` | Use a custom webpack version in CLI. |
134+
| `WEBPACK_CLI_HELP_WIDTH` | Use custom width for help output. |
135+
136+
## Configuration Environment Variables
137+
138+
You can use the following environment variables inside your webpack configuration:
139+
140+
| Environment Variable | Description |
141+
| -------------------- | -------------------------------------------- |
142+
| `WEBPACK_SERVE` | `true` if `serve\|s` is being used. |
143+
| `WEBPACK_BUILD` | `true` if `build\|bundle\|b` is being used. |
144+
| `WEBPACK_WATCH` | `true` if `--watch\|watch\|w` is being used. |
145+
146+
Checkout [webpack.js.org](https://webpack.js.org/api/cli/) for more detailed documentation of `webpack-cli`.

0 commit comments

Comments
 (0)