Environment-specific builds with Vite mode (or other solution)? #3126
micah-redwood
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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 Vike, a lower-level abstraction on top of Vite, where you can use Vite modes to control what
.env
files are used during build (e.g..env
and.env.staging
are used if you dovite build --mode staging
)Vite Mode / Environments docs: https://vite.dev/guide/env-and-mode
This is currently broken in TanStack Start due to lack of Vinxi support (issue and PR) for passing
--mode
to Vite. I'm sure it'll eventually be fixed, but it makes me wonder, how are others solving this problem currently?Does TanStack Start have a "blessed" way of handling different configurations for different environments (dev / staging / qa / preview / production)? I had assumed Vite modes was the standard way, but it seems like very few people are running into this, so I'm a bit puzzled and want to make sure there isn't an obvious solution that I'm missing.
Beta Was this translation helpful? Give feedback.
All reactions