TanStackT
TanStack13mo ago
1 reply
dual-salmon

.env files in TanStack Start?

Hey folks, how are you managing environment variables (or other env-specific configuration) in TanStack Start?

I've always used Vite modes for this (e.g. create .env.staging file and build with vite build --mode staging ) but wasn't sure if this was the right way to do things with TanStack Start or if there's a better pattern? I realize you can manually define env vars with your hosting provider, but it's nice to use
.env
files for non-secret values (e.g. API base urls, etc)
Started discussion here: https://github.com/TanStack/router/discussions/3126
GitHub
I'm curious how TanStack Start users are managing environmental variables in code (e.g. .env files) for different environments (e.g. dev / staging / prod). I'm coming to TanStack Start from...
Environment-specific builds with Vite mode (or other solution)? · T...
Was this page helpful?