docs: add documentation on nuxt2 command (#23211)

This commit is contained in:
Ryota Watanabe 2023-09-14 20:56:38 +09:00 committed by GitHub
parent f000e8b605
commit edbc471583
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 2 deletions

View File

@ -73,7 +73,24 @@ export default defineNuxtConfig({
})
```
Try running `nuxt dev` once here. You will see that the application works as before.
### Update Commands
The `nuxt` command should now be changed to the `nuxt2` command.
```diff
{
"scripts": {
- "dev": "nuxt",
+ "dev": "nuxt2",
- "build": "nuxt build",
+ "build": "nuxt2 build",
- "start": "nuxt start",
+ "start": "nuxt2 start"
}
}
```
Try running `nuxt2` once here. You will see that the application works as before.
(If 'bridge' is set to false, your application will operate without any changes as before.)

View File

@ -20,6 +20,20 @@ export default defineNuxtConfig({
You will also need to update your scripts within your `package.json` to reflect the fact that Nuxt will now produce a Nitro server as build output.
### Install Nuxi
Install `nuxi` as a development dependency:
::code-group
```bash [Yarn]
yarn add --dev nuxi
```
```bash [npm]
npm install -D nuxi
```
### Nuxi
Nuxt 3 introduced the new Nuxt CLI command [`nuxi`](/docs/api/commands/add). Update your scripts as follows to leverage the better support from Nuxt Bridge:
@ -38,7 +52,7 @@ Nuxt 3 introduced the new Nuxt CLI command [`nuxi`](/docs/api/commands/add). Upd
```
::alert
If `nitro: false`, use the `nuxt` command.
If `nitro: false`, use the `nuxt2` command.
::
### Static Target