Skip to content

Commit

Permalink
docs: fix access to env var using VITE_ prefix in README.md (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv authored Dec 5, 2024
1 parent 7738eea commit c382eac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ To add an environment variable:
3. Edit `./vite-env.d.ts` and in the `ImportMetaEnv` interface, add your variable with the appropriate type, e.g.

`readonly VITE_MY_API_KEY: string;`
4. Then you can read the variable via `import.meta.env.MY_API_KEY` (learn more at [Env Variables and Modes](https://vite.dev/guide/env-and-mode))
4. Then you can read the variable via `import.meta.env.VITE_MY_API_KEY` (learn more at [Env Variables and Modes](https://vite.dev/guide/env-and-mode))

#### If you want to set it for each package independently:

Expand Down

0 comments on commit c382eac

Please sign in to comment.