aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/ecosystem/nuxt.md
blob: ca42c765bcbdf50f0ca158bdbca053e2b0932b7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
name: Build an app with Nuxt and Bun
---

Bun supports [Nuxt](https://nuxt.com) out of the box. Initialize a Nuxt app with official `nuxi` CLI.

```sh
$ bunx nuxi init my-nuxt-app
✔ Which package manager would you like to use?
bun
◐ Installing dependencies...
bun install v1.x (16b4bf34)
 + @nuxt/devtools@0.8.2
 + nuxt@3.7.0
 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`).

{% callout %}
The `nuxt` CLI uses Node.js by default; passing the `--bun` flag forces the dev server to use the Bun runtime instead.
{% /callout %}

```
$ 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](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.

{% image src="https://github.com/oven-sh/bun/assets/3084745/2c683ecc-3298-4bb0-b8c0-cf4cfaea1daa" caption="Demo Nuxt app running on localhost" /%}

---

Refer to the [Nuxt website](https://nuxt.com/docs) for complete documentation.
022-10-17Update README.mdGravatar Jarred Sumner 1-10/+35 2022-10-17Update README.mdGravatar Jarred Sumner 1-1/+0 2022-10-17Update README.mdGravatar Jarred Sumner 1-6/+69 2022-10-17Clean up some codeGravatar Jarred Sumner 2-34/+35 2022-10-17Fix headers + add testGravatar Jarred Sumner 2-5/+24 2022-10-17More testsGravatar Jarred Sumner 1-3/+293 2022-10-17Implement `error` and `binaryType`Gravatar Jarred Sumner 4-30/+163 2022-10-17Handle .zero betterGravatar Jarred Sumner 1-0/+4 2022-10-17RedoGravatar Jarred Sumner 1-46/+45 2022-10-17Redo WebSocket apiGravatar Jarred Sumner 9-383/+510 2022-10-16Reflecting new home for bun templates (#1317)Gravatar Dennis Dudek 73-1633/+3 2022-10-16ymlGravatar Jarred Sumner 3-6/+6 2022-10-16Fix #1335Gravatar Jarred Sumner 1-9/+5 2022-10-16Revert "disable lto for UWS to workaround bug under load"Gravatar Jarred Sumner 1-1/+1 2022-10-16Disable InlineBlob optimizationGravatar Jarred Sumner 2-210/+247 2022-10-16disable lto for UWS to workaround bug under loadGravatar Jarred Sumner 1-1/+1 2022-10-16Add a commentGravatar Jarred Sumner 1-0/+1 2022-10-16Make debug logs configurableGravatar Jarred Sumner 1-3/+28 2022-10-16Name the threadGravatar Jarred Sumner 1-0/+1 2022-10-16Changed apiGravatar Jarred Sumner 1-4/+64 2022-10-16snapshotsGravatar Jarred Sumner 43-142/+142 2022-10-16Update uwsGravatar Jarred Sumner 1-0/+0 2022-10-16Set `Date` headerGravatar Jarred Sumner 1-0/+0 2022-10-16Make more sure we know what the types we are sending areGravatar Jarred Sumner 1-5/+5 2022-10-16Fix WebSocket server sending invalid data at the endGravatar Jarred Sumner 1-8/+10 2022-10-16Fail earlier when there are encoding errorsGravatar Jarred Sumner 1-25/+37 2022-10-15Disable some loggingGravatar Jarred Sumner 2-2/+2 2022-10-15More careful code generatorGravatar Jarred Sumner 1-5/+10 2022-10-15Simplify code that turns a fetch() response into a JSResponseGravatar Jarred Sumner 1-18/+24 2022-10-15Simplify the code that reads HTTP client request bodiesGravatar Jarred Sumner 2-136/+22