skills/bun-guides-ecosystem-vite/SKILL.md
Build a frontend using Vite and Bun
npx skillsauth add jarle/bun-skills Bun Build a frontend using Vite and BunInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Vite works out of the box with Bun. Get started with one of Vite's templates.
bun create vite my-app
✔ Select a framework: › React
✔ Select a variant: › TypeScript + SWC
Scaffolding project in /path/to/my-app...
Then cd into the project directory and install dependencies.
cd my-app
bun install
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.
bunx --bun vite
To simplify this command, update the "dev" script in package.json to the following.
"scripts": {
"dev": "vite", // [!code --]
"dev": "bunx --bun vite", // [!code ++]
"build": "vite build",
"serve": "vite preview"
},
// ...
Now you can start the development server with bun run dev.
bun run dev
The following command will build your app for production.
bunx --bun vite build
This is a stripped down guide to get you started with Vite + Bun. For more information, see the Vite documentation.
development
Using TypeScript with Bun, including type definitions and compiler options
development
Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers
testing
Learn how to use snapshot testing in Bun to save and compare output between test runs
testing
Learn about Bun test's runtime integration, environment variables, timeouts, and error handling