Skip to content

Commit 45399b1

Browse files
rimutakahaoqunjiang
authored andcommitted
Explain when .env files are loaded. (#4171)
It appears that .env files are only loaded at the start of `vue-cli-service` and are not watched for hot reloads. **I am actually not sure this is the case for everyone, but is so for me.** I think it is worth noting because the expectation is that a file at the root of the project would be watched for hot reloads. (cherry picked from commit b22bedb)
1 parent c6cab26 commit 45399b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/guide/mode-and-env.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Loaded variables will become available to all `vue-cli-service` commands, plugin
5555
An env file for a specific mode (e.g. `.env.production`) will take higher priority than a generic one (e.g. `.env`).
5656

5757
In addition, environment variables that already exist when Vue CLI is executed have the highest priority and will not be overwritten by `.env` files.
58+
59+
`.env` files are loaded at the start of `vue-cli-service`. Restart the service after making changes.
5860
:::
5961

6062
### Example: Staging Mode

0 commit comments

Comments
 (0)