docs: use nuxi everywhere (#1577)

This commit is contained in:
Anthony Fu 2021-10-29 18:38:22 +08:00 committed by GitHub
parent f60f461410
commit 495aeffd74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 48 additions and 31 deletions

View File

@ -55,26 +55,43 @@ npm install -D @nuxt/bridge@npm:@nuxt/bridge-edge
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. 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.
#### Nuxi
Nuxt 3 introduced the new Nuxt CLI command [`nuxi`](/getting-started/commands/). Update your scripts as follows to leverage the better support from Nuxt Bridge:
```diff
{
"scripts": {
- "dev": "nuxt",
+ "dev": "nuxi dev",
- "build": "nuxt build",
+ "build": "nuxi build",
- "start": "nuxt start",
+ "start": "node .output/server/index.mjs"
}
}
```
#### Static target #### Static target
If you have set `target: 'static'` in your `nuxt.config` then you need to ensure that you update your build script to be `nuxt generate`. If you have set `target: 'static'` in your `nuxt.config` then you need to ensure that you update your build script to be `nuxi generate`.
```json ```json
{ {
"scripts": { "scripts": {
"build": "nuxt generate" "build": "nuxi generate"
} }
} }
``` ```
#### Server target #### Server target
For all other situations, you can use the normal `nuxt build` command. For all other situations, you can use the `nuxi build` command.
```json ```json
{ {
"scripts": { "scripts": {
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -2,7 +2,7 @@
"name": "docs", "name": "docs",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "yarn gendocs && nuxt dev", "dev": "yarn gendocs && nuxi dev",
"build": "yarn gendocs && nuxt generate --force-build", "build": "yarn gendocs && nuxt generate --force-build",
"build:ci": "yarn add @nuxt/kit@npm:@nuxt/kit-edge && yarn build", "build:ci": "yarn add @nuxt/kit@npm:@nuxt/kit-edge && yarn build",
"gendocs": "jiti ./scripts/gen-docs.ts" "gendocs": "jiti ./scripts/gen-docs.ts"

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server" "start": "node .output/server"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -14,7 +14,7 @@
"release": "yarn && yarn lint && FORCE_COLOR=1 lerna publish -m \"chore: release\" && yarn stub", "release": "yarn && yarn lint && FORCE_COLOR=1 lerna publish -m \"chore: release\" && yarn stub",
"nuxi": "./node_modules/.bin/nuxi", "nuxi": "./node_modules/.bin/nuxi",
"nuxt": "./node_modules/.bin/nuxi", "nuxt": "./node_modules/.bin/nuxi",
"play": "yarn run nuxt dev playground", "play": "yarn run nuxi dev playground",
"example": "yarn workspace example-$0 dev", "example": "yarn workspace example-$0 dev",
"example:build": "yarn workspace example-$0 build", "example:build": "yarn workspace example-$0 build",
"lint": "eslint --ext .vue,.ts,.js .", "lint": "eslint --ext .vue,.ts,.js .",

View File

@ -5,8 +5,8 @@
"nuxt3": "latest" "nuxt3": "latest"
}, },
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build", "build": "nuxi build",
"start": "node .output/server/index.mjs" "start": "node .output/server/index.mjs"
} }
} }

View File

@ -2,6 +2,6 @@
"private": true, "private": true,
"name": "fixture-bridge", "name": "fixture-bridge",
"scripts": { "scripts": {
"build": "nuxt build" "build": "nuxi build"
} }
} }

View File

@ -2,8 +2,8 @@
"private": true, "private": true,
"name": "fixture-basic", "name": "fixture-basic",
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxi dev",
"build": "nuxt build" "build": "nuxi build"
}, },
"devDependencies": { "devDependencies": {
"@nuxt/bridge": "*", "@nuxt/bridge": "*",