Skip to content

Commit

Permalink
docs(guides): correct bash command in environment-variables.md (#4107)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamspark1e committed Oct 30, 2020
1 parent 693a2eb commit 612e377
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content/guides/environment-variables.md
Expand Up @@ -20,10 +20,10 @@ T> webpack's environment variables are different from the [environment variables
The webpack command line [environment option](/api/cli/#environment-options) `--env` allows you to pass in as many environment variables as you like. Environment variables will be made accessible in your `webpack.config.js`. For example, `--env.production` or `--env.NODE_ENV=local` (`NODE_ENV` is conventionally used to define the environment type, see [here](https://dzone.com/articles/what-you-should-know-about-node-env).)

```bash
webpack --env.NODE_ENV=local --env.production --progress
webpack --env NODE_ENV=local --env production --progress
```

T> Setting up your `env` variable without assignment, `--env.production` sets `--env.production` to `true` by default. There are also other syntaxes that you can use. See the [webpack CLI](/api/cli/#environment-options) documentation for more information.
T> Setting up your `env` variable without assignment, `--env production` sets `--env production` to `true` by default. There are also other syntaxes that you can use. See the [webpack CLI](/api/cli/#environment-options) documentation for more information.

There is one change that you will have to make to your webpack config. Typically, `module.exports` points to the configuration object. To use the `env` variable, you must convert `module.exports` to a function:

Expand Down

1 comment on commit 612e377

@vercel
Copy link

@vercel vercel bot commented on 612e377 Oct 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.