Skip to content

Commit

Permalink
docs: add more information (#2683)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed May 1, 2021
1 parent 0fc3eec commit 9d46b72
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/webpack-cli/README.md
Expand Up @@ -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`.

0 comments on commit 9d46b72

Please sign in to comment.