diff --git a/docs/guide/mode-and-env.md b/docs/guide/mode-and-env.md index 03437e39a3..806a14c024 100644 --- a/docs/guide/mode-and-env.md +++ b/docs/guide/mode-and-env.md @@ -46,6 +46,8 @@ FOO=bar VUE_APP_SECRET=secret ``` +Note that only variables that start with `VUE_APP_` will be statically embedded into the client bundle with `webpack.DefinePlugin`. + For more detailed env parsing rules, please refer to [the documentation of `dotenv`](https://github.com/motdotla/dotenv#rules). We also use [dotenv-expand](https://github.com/motdotla/dotenv-expand) for variable expansion (available in Vue CLI 3.5+). Loaded variables will become available to all `vue-cli-service` commands, plugins and dependencies. @@ -80,7 +82,7 @@ In both cases, the app is built as a production app because of the `NODE_ENV`, b ### Using Env Variables in Client-side Code -Only variables that start with `VUE_APP_` will be statically embedded into the client bundle with `webpack.DefinePlugin`. You can access them in your application code: +You can access env variables in your application code: ``` js console.log(process.env.VUE_APP_SECRET)