Skip to content

Commit

Permalink
docs: mention process.env for config env vars (#7744)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Apr 14, 2022
1 parent 5d96dca commit 434bb5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/config/index.md
Expand Up @@ -101,7 +101,9 @@ export default defineConfig(async ({ command, mode }) => {

### Environment Variables

Vite doesn't load `.env` files by default as the files to load can only be determined after evaluating the Vite config, for example, the `root` and `envDir` options affects the loading behaviour. However, you can use the exported `loadEnv` helper to load the specific `.env` file if needed.
Environmental Variables can be obtained from `process.env` as usual.

Note that Vite doesn't load `.env` files by default as the files to load can only be determined after evaluating the Vite config, for example, the `root` and `envDir` options affects the loading behaviour. However, you can use the exported `loadEnv` helper to load the specific `.env` file if needed.

```js
import { defineConfig, loadEnv } from 'vite'
Expand Down

0 comments on commit 434bb5c

Please sign in to comment.