Support separate asset base (CDN) vs app base in TanStack Start (Vite) #5036
Nandan1996
started this conversation in
Ideas
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.
-
Problem
We need the application to live at /app-base-path (e.g., https://www.example.com/app-base-path) while all built assets (JS/CSS) are served from a CDN like https://edge.example.com/asset-path. With TanStack Start today, Vite’s base config is used as a single source of truth (TSS_APP_BASE) for both routing and asset URLs, so we can’t configure a separate asset base without affecting the app base.
What we’ve tried
base: '/app-base-path'
+ routerbasepath: '/app-base-path'
→ routes work, but assets resolve under /app-base-path on the origin.base
makes the server/app base follow the CDN URL, which breaks routing/server paths.What we’re asking
Possible approaches (examples)
Why this helps
Is there an undocumented way to do this today? If not, would you consider adding support for a split asset base?
Beta Was this translation helpful? Give feedback.
All reactions