Environment variables in built application
I've been building a new web application using the latest version of tanstack start.
I've got a
.env file in my root directory and the vinxi dev command is able to read from it no issueWhen I run
vinxi build and then vinxi start - I end up with an application where the env vars are not being used.I've found that hardcoding them to the start command
MY_SECRET=abc123 vinxi start allows me to access the env var from the built code– I'm curious why it's not automatically using the .env file like the dev server does?Is this a node issue, vinxi issue, start issue, or just a misunderstanding on my end of how this works?
(I'm not necessarily blocked by this since I'm able to pass all my needed environment variables as part of the initial start command– but I'm curious as to why the
vinxi start command isn't automatically loading .env for me and if there's a more graceful way to load them without needing to have them all listed out in front of my vinxi start command. Does that make sense?)Thanks!