Skip to content

Commit 45cc5e9

Browse files
committed
docs: add tip about env loading priorities
1 parent 7b93b55 commit 45cc5e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/guide/mode-and-env.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ VUE_APP_SECRET=secret
1818

1919
Loaded variables will become available to all `vue-cli-service` commands, plugins and dependencies.
2020

21+
::: tip Env Loading Priorities
22+
23+
An env file for a specific mode (e.g. `.env.production`) will take higher priority than a generic one (e.g. `.env`).
24+
25+
In addition, environment variables that already exist when Vue CLI is bootstrapped have the highest priority and will not be overwritten by `.env` files. If you have a default `NODE_ENV` in your environment, you might want to consider removing it.
26+
:::
27+
2128
## Modes
2229

2330
**Mode** is an important concept in Vue CLI projects. By default, there are three modes in a Vue CLI project:

0 commit comments

Comments
 (0)