mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 14:48:41 +00:00
docs: env expand feature only works for variables in env files (#18354)
This commit is contained in:
parent
93b03b2692
commit
e9c9767ba5
@ -55,7 +55,7 @@ console.log(import.meta.env.DB_PASSWORD) // undefined
|
||||
As shown above, `VITE_SOME_KEY` is a number but returns a string when parsed. The same would also happen for boolean env variables. Make sure to convert to the desired type when using it in your code.
|
||||
:::
|
||||
|
||||
Also, Vite uses [dotenv-expand](https://github.com/motdotla/dotenv-expand) to expand variables out of the box. To learn more about the syntax, check out [their docs](https://github.com/motdotla/dotenv-expand#what-rules-does-the-expansion-engine-follow).
|
||||
Also, Vite uses [dotenv-expand](https://github.com/motdotla/dotenv-expand) to expand variables written in env files out of the box. To learn more about the syntax, check out [their docs](https://github.com/motdotla/dotenv-expand#what-rules-does-the-expansion-engine-follow).
|
||||
|
||||
Note that if you want to use `$` inside your environment value, you have to escape it with `\`.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user