You can use Vite with Bun, but many projects get faster builds & drop hundreds of dependencies by switching to HTML
imports.
Vite works with Bun with no extra configuration. Get started with one of Vite’s templates.
terminal
Then
cd into the project directory and install dependencies.
terminal
Start the development server with the
vite CLI using bunx.
The --bun flag tells Bun to run Vite’s CLI using bun instead of node; by default Bun respects Vite’s #!/usr/bin/env node shebang line.
terminal
To simplify this command, update the
"dev" script in package.json to the following.
package.json
Now you can start the development server with
bun run dev.
terminal
Build your app for production.
terminal
For more information, see the Vite documentation.