skills/bun-guides-ecosystem-nuxt/SKILL.md
Build an app with Nuxt and Bun
npx skillsauth add jarle/bun-skills Bun Build an app with Nuxt 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.
Bun supports Nuxt out of the box. Initialize a Nuxt app with official nuxi CLI.
bunx nuxi init my-nuxt-app
✔ Which package manager would you like to use?
bun
◐ Installing dependencies...
bun install v1.3.3 (16b4bf34)
+ @nuxt/[email protected]
+ [email protected]
785 packages installed [2.67s]
✔ Installation completed.
✔ Types generated in .nuxt
✨ Nuxt project has been created with the v3 template. Next steps:
› cd my-nuxt-app
› Start development server with bun run dev
To start the dev server, run bun --bun run dev from the project root. This will execute the nuxt dev command (as defined in the "dev" script in package.json).
cd my-nuxt-app
bun --bun run dev
nuxt dev
Nuxi 3.6.5
Nuxt 3.6.5 with Nitro 2.5.2
> Local: http://localhost:3000/
> Network: http://192.168.0.21:3000/
> Network: http://[fd8a:d31d:481c:4883:1c64:3d90:9f83:d8a2]:3000/
✔ Nuxt DevTools is enabled v0.8.0 (experimental)
ℹ Vite client warmed up in 547ms
✔ Nitro built in 244 ms
Once the dev server spins up, open http://localhost:3000 to see the app. The app will render Nuxt's built-in NuxtWelcome template component.
To start developing your app, replace <NuxtWelcome /> in app.vue with your own UI.
For production build, while the default preset is already compatible with Bun, you can also use Bun preset to generate better optimized builds.
export default defineNuxtConfig({
nitro: {
preset: "bun", // [!code ++]
},
});
Alternatively, you can set the preset via environment variable:
NITRO_PRESET=bun bun run build
<Note>
Some packages provide Bun-specific exports that Nitro will not bundle correctly using the default preset. In this
case, you need to use Bun preset so that the packages will work correctly in production builds.
</Note>
After building with bun, run:
bun run ./.output/server/index.mjs
Refer to the Nuxt website for complete 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