Skip to content

Commit

Permalink
docs: use nuxi everywhere (nuxt#1577)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu authored Oct 29, 2021
1 parent f60f461 commit 495aeff
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 31 deletions.
25 changes: 21 additions & 4 deletions docs/content/1.getting-started/3.bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

#### 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

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
{
"scripts": {
"build": "nuxt generate"
"build": "nuxi generate"
}
}
```

#### 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
{
"scripts": {
"build": "nuxt build",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "docs",
"private": true,
"scripts": {
"dev": "yarn gendocs && nuxt dev",
"dev": "yarn gendocs && nuxi dev",
"build": "yarn gendocs && nuxt generate --force-build",
"build:ci": "yarn add @nuxt/kit@npm:@nuxt/kit-edge && yarn build",
"gendocs": "jiti ./scripts/gen-docs.ts"
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/use-async-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/use-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/use-meta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server"
}
}
4 changes: 2 additions & 2 deletions examples/use-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-composables/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-layouts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"release": "yarn && yarn lint && FORCE_COLOR=1 lerna publish -m \"chore: release\" && yarn stub",
"nuxi": "./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:build": "yarn workspace example-$0 build",
"lint": "eslint --ext .vue,.ts,.js .",
Expand Down
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
}
}
2 changes: 1 addition & 1 deletion test/fixtures/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"private": true,
"name": "fixture-bridge",
"scripts": {
"build": "nuxt build"
"build": "nuxi build"
}
}
4 changes: 2 additions & 2 deletions test/fixtures/bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"private": true,
"name": "fixture-basic",
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build"
"dev": "nuxi dev",
"build": "nuxi build"
},
"devDependencies": {
"@nuxt/bridge": "*",
Expand Down

0 comments on commit 495aeff

Please sign in to comment.