-
-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Built-in .env
support
#989
Comments
This would be great! Was just trying to find why the . |
You're right and I'm realizing that the new docs actually don't work for the server-side. I'll implement it tentatively this weekend. |
Almost done, I'll finish tomorrow. |
Done: use
As descried in the docs, you'll still need to manutally install Closing: once #562 is implemented I'll consider environement variables to have well polished DX. |
Wonderful. Thanks for the quick turnaround ! |
Sure 👍 Btw. in case you're able to convince your employer: https://github.com/sponsors/brillout — it has a substantial impact. |
In this case, it's just for a personal project. Though if I do use it for my employer then I will for sure 😊 |
Thanks & have fun with your personal project (can't wait to fix all paper cuts and release the v1 👀). |
Description
While Vite has built-in support for
.env
files, it only includes environment variables prefixed withVITE_
.The official recommendation is to install
dotenv
. But better yet, vite-plugin-ssr should have built-in support including niceties such as HMR and accessing all environment variable overimport.meta.env
(only on the server-side of course). Maybe also changing the prefix fromVITE_
toPUBLIC_
.The text was updated successfully, but these errors were encountered: