From c382eac0db8b922a62f4392fc61014ed68aea1d7 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Thu, 5 Dec 2024 13:22:04 +0800 Subject: [PATCH] docs: fix access to env var using VITE_ prefix in README.md (#793) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 91a2515bf..682d107e6 100755 --- a/README.md +++ b/README.md @@ -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: