Skip to content

Commit

Permalink
Add link to Vite env var issue
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed May 16, 2021
1 parent dad93fc commit 6f10193
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion documentation/faq/60-env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
question: How do I use environment variables?
---

Vite uses [dotenv](https://github.com/motdotla/dotenv) to load environment variables from a file named `.env` or similar. Only environment variables prefixed with `VITE_` are exposed. You would need to instantiate dotenv yourself if you want all environment variables exposed in `process.env['YOUR_ENV_VAR']`.
Vite uses [dotenv](https://github.com/motdotla/dotenv) to load environment variables from a file named `.env` or similar. Only environment variables prefixed with `VITE_` are exposed. You would need to instantiate dotenv yourself if you want all environment variables exposed in `process.env['YOUR_ENV_VAR']`. We hope to see all environment variables exposed on the server-side [in the future](https://github.com/vitejs/vite/issues/3176).

For example, you can create a `.env` file in your project root folder with a `VITE_*` variable:

Expand Down

0 comments on commit 6f10193

Please sign in to comment.