From 9d46b72065cedf04c45c4e71a3f34453154eaf41 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sat, 1 May 2021 19:21:06 +0530 Subject: [PATCH] docs: add more information (#2683) --- packages/webpack-cli/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/webpack-cli/README.md b/packages/webpack-cli/README.md index 9c6e0010146..8ec8b13e69d 100644 --- a/packages/webpack-cli/README.md +++ b/packages/webpack-cli/README.md @@ -115,3 +115,32 @@ Global options: ### webpack 5 Checkout [`OPTIONS.md`](https://github.com/webpack/webpack-cli/blob/master/OPTIONS.md) to see list of all available options. + +## Exit codes and their meanings + +| Exit Code | Description | +| --------- | -------------------------------------------------- | +| `0` | Success | +| `1` | Errors from webpack | +| `2` | Configuration/options problem or an internal error | + +## CLI Environment Variables + +| Environment Variable | Description | +| ----------------------------------- | ------------------------------------------------------------------- | +| `WEBPACK_CLI_SKIP_IMPORT_LOCAL` | when `true` it will skip using the local instance of `webpack-cli`. | +| `WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG` | when `true` it will force load the ESM config. | +| `WEBPACK_PACKAGE` | Use a custom webpack version in CLI. | +| `WEBPACK_CLI_HELP_WIDTH` | Use custom width for help output. | + +## Configuration Environment Variables + +You can use the following environment variables inside your webpack configuration: + +| Environment Variable | Description | +| -------------------- | -------------------------------------------- | +| `WEBPACK_SERVE` | `true` if `serve\|s` is being used. | +| `WEBPACK_BUILD` | `true` if `build\|bundle\|b` is being used. | +| `WEBPACK_WATCH` | `true` if `--watch\|watch\|w` is being used. | + +Checkout [webpack.js.org](https://webpack.js.org/api/cli/) for more detailed documentation of `webpack-cli`.