Search
⌘ K
Bun
Prerequisites
To use Bun
with the Pinx project, there are just a few changes to make:
Vue
Change the dev
and build
commands in the package.json
file:
{
...,
"scripts": {
"dev": "bunx --bun vite",
"build-only": "bunx --bun vite build",
"preview": "bunx --bun vite build && echo '' && bunx --bun vite preview --port 4173 --host",
"preview-only": "bunx --bun vite preview --port 4173 --host",
...
},
...
}
Then, you can run the app with these commands:
# start the development
bun run dev
# build for production
bun run build
# start preview
bun run preview
You can find more information here: https://bun.sh/guides/ecosystem/vite
Nuxt
For Nuxt, you only need to replace npm run
with bun --bun run
, for example:
# start the development
bun --bun run dev
# build for production
bun --bun run build
# start build preview
bun .output/server/index.mjs
# generate static site
bun --bun run generate
# serve static site
bunx serve .output/public
# start preview
bun run preview
You can find more information here: https://bun.sh/guides/ecosystem/nuxt