From 612e377559d371590febd3728a1656e5ba49aaa8 Mon Sep 17 00:00:00 2001 From: Sparkling Date: Fri, 30 Oct 2020 21:24:44 +0800 Subject: [PATCH] docs(guides): correct bash command in environment-variables.md (#4107) --- src/content/guides/environment-variables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/guides/environment-variables.md b/src/content/guides/environment-variables.md index 227ec9aa5d9a..408de91b9730 100644 --- a/src/content/guides/environment-variables.md +++ b/src/content/guides/environment-variables.md @@ -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: