Skip to content

Commit

Permalink
docs(api): update cli (#6540)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxsan committed Dec 10, 2022
1 parent 94c6d7d commit 5ecb426
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/content/api/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,7 @@ module.exports = (env, argv) => {

### node-env

For `webpack-cli v4`.

You can use `--node-env` option to set `process.env.NODE_ENV`:
You can use `--node-env` option to set `process.env.NODE_ENV`, which is available to both user code and webpack configuration:

```bash
npx webpack --node-env production # process.env.NODE_ENV = 'production'
Expand All @@ -616,7 +614,7 @@ T> The `mode` option would respect the `--node-env` option if you don't set it e

For `webpack-cli v5+`.

You can use `--define-process-env-node-env` option to set `process.env.NODE_ENV`:
An alias for [`--node-env`](/api/cli/#node-env) to set `process.env.NODE_ENV`:

```bash
npx webpack --define-process-env-node-env production # process.env.NODE_ENV = 'production'
Expand Down

0 comments on commit 5ecb426

Please sign in to comment.