1
Create a new TanStack Start app
Use the interactive CLI to create a new TanStack Start app.
terminal
2
Start the dev server
Change to the project directory and run the dev server with Bun.This starts the Vite dev server with Bun.
terminal
3
Update scripts in package.json
Modify the scripts field in your
package.json by prefixing the Vite CLI commands with bun --bun. This ensures that Bun executes the Vite CLI for common tasks like dev, build, and preview.package.json
Hosting
1
Add Nitro to your project
Add Nitro to your project. This tool allows you to deploy your TanStack Start app to different platforms.
terminal
2
Update your vite.config.ts file
Update your
vite.config.ts
vite.config.ts file to include the necessary plugins for TanStack Start with Bun.The
bun preset is optional, but it configures the build output specifically for Bun’s runtime.3
Update the start command
Make sure
build and start scripts are present in your package.json file:package.json
You do not need the custom
start script when deploying to Vercel.4
Deploy your app
Check out one of our guides to deploy your app to a hosting provider.
When deploying to Vercel, you can either add the
vite.config.ts
"bunVersion": "1.x" to your vercel.json file, or add it to the nitro config in your vite.config.ts file: