Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add more information #2683

Merged
merged 2 commits into from May 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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`.