Skip to content

Commit 8492055

Browse files
techieforfunNataliaTepluhina
authored andcommitted
Update mode-and-env.md (#4257)
* Update mode-and-env.md Fixed example of keys, which they should start with VUE_APP_ * Update mode-and-env.md change position of the tip * Update docs/guide/mode-and-env.md Co-Authored-By: Natalia Tepluhina <[email protected]> (cherry picked from commit 149b307)
1 parent a8df1df commit 8492055

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/guide/mode-and-env.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ FOO=bar
4646
VUE_APP_SECRET=secret
4747
```
4848

49+
Note that only variables that start with `VUE_APP_` will be statically embedded into the client bundle with `webpack.DefinePlugin`.
50+
4951
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+).
5052

5153
Loaded variables will become available to all `vue-cli-service` commands, plugins and dependencies.
@@ -82,7 +84,7 @@ In both cases, the app is built as a production app because of the `NODE_ENV`, b
8284

8385
### Using Env Variables in Client-side Code
8486

85-
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:
87+
You can access env variables in your application code:
8688

8789
``` js
8890
console.log(process.env.VUE_APP_SECRET)

0 commit comments

Comments
 (0)