@nuxt/docs 3.17.4 → 4.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1.getting-started/01.introduction.md +3 -3
- package/1.getting-started/03.configuration.md +1 -1
- package/1.getting-started/04.views.md +3 -1
- package/1.getting-started/06.styling.md +3 -1
- package/1.getting-started/07.routing.md +1 -1
- package/1.getting-started/11.state-management.md +1 -1
- package/1.getting-started/12.error-handling.md +1 -1
- package/1.getting-started/15.prerendering.md +7 -7
- package/1.getting-started/16.deployment.md +2 -2
- package/1.getting-started/17.testing.md +1 -1
- package/1.getting-started/18.upgrade.md +9 -6
- package/2.guide/1.concepts/3.rendering.md +2 -2
- package/2.guide/1.concepts/5.modules.md +1 -1
- package/2.guide/1.concepts/8.typescript.md +6 -6
- package/2.guide/1.concepts/9.code-style.md +1 -1
- package/2.guide/2.directory-structure/1.composables.md +1 -1
- package/2.guide/2.directory-structure/1.content.md +1 -1
- package/2.guide/2.directory-structure/1.pages.md +5 -1
- package/2.guide/2.directory-structure/1.server.md +1 -1
- package/2.guide/2.directory-structure/2.env.md +4 -4
- package/2.guide/3.going-further/1.events.md +1 -1
- package/2.guide/3.going-further/1.experimental-features.md +1 -53
- package/2.guide/3.going-further/1.internals.md +2 -2
- package/2.guide/3.going-further/10.runtime-config.md +1 -1
- package/2.guide/3.going-further/11.nightly-release-channel.md +2 -6
- package/2.guide/3.going-further/3.modules.md +3 -3
- package/2.guide/3.going-further/9.debugging.md +1 -5
- package/2.guide/4.recipes/4.sessions-and-authentication.md +3 -3
- package/3.api/1.components/10.nuxt-picture.md +1 -1
- package/3.api/1.components/9.nuxt-img.md +1 -1
- package/3.api/2.composables/use-async-data.md +1 -1
- package/3.api/2.composables/use-fetch.md +1 -1
- package/3.api/2.composables/use-preview-mode.md +3 -3
- package/3.api/4.commands/add.md +20 -20
- package/3.api/4.commands/analyze.md +2 -2
- package/3.api/4.commands/build-module.md +2 -2
- package/3.api/4.commands/build.md +2 -2
- package/3.api/4.commands/cleanup.md +2 -2
- package/3.api/4.commands/dev.md +3 -3
- package/3.api/4.commands/devtools.md +3 -3
- package/3.api/4.commands/generate.md +3 -3
- package/3.api/4.commands/info.md +2 -2
- package/3.api/4.commands/init.md +3 -3
- package/3.api/4.commands/module.md +8 -8
- package/3.api/4.commands/prepare.md +2 -2
- package/3.api/4.commands/preview.md +3 -3
- package/3.api/4.commands/typecheck.md +2 -2
- package/3.api/4.commands/upgrade.md +2 -2
- package/3.api/5.kit/11.nitro.md +1 -1
- package/3.api/5.kit/7.pages.md +1 -1
- package/3.api/6.advanced/1.hooks.md +1 -1
- package/3.api/6.nuxt-config.md +2956 -3
- package/5.community/4.contribution.md +1 -1
- package/5.community/7.changelog.md +1 -1
- package/7.migration/2.configuration.md +2 -2
- package/package.json +1 -1
|
@@ -103,8 +103,8 @@ const { data } = await useFetch('/api/preview', {
|
|
|
103
103
|
Now you can generate your site and serve it:
|
|
104
104
|
|
|
105
105
|
```bash [Terminal]
|
|
106
|
-
npx
|
|
107
|
-
npx
|
|
106
|
+
npx nuxt generate
|
|
107
|
+
npx nuxt preview
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
Then you can see your preview page by adding the query param `preview` to the end of the page you want to see once:
|
|
@@ -114,5 +114,5 @@ Then you can see your preview page by adding the query param `preview` to the en
|
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
::note
|
|
117
|
-
`usePreviewMode` should be tested locally with `
|
|
117
|
+
`usePreviewMode` should be tested locally with `nuxt generate` and then `nuxt preview` rather than `nuxt dev`. (The [preview command](/docs/api/commands/preview) is not related to preview mode.)
|
|
118
118
|
::
|
package/3.api/4.commands/add.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt add"
|
|
3
3
|
description: "Scaffold an entity into your Nuxt application."
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--add-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt add <TEMPLATE> <NAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--force]
|
|
14
14
|
```
|
|
15
15
|
<!--/add-cmd-->
|
|
16
16
|
|
|
@@ -39,74 +39,74 @@ Some templates support additional modifier flags to add a suffix (like `.client`
|
|
|
39
39
|
|
|
40
40
|
```bash [Terminal]
|
|
41
41
|
# Generates `/plugins/sockets.client.ts`
|
|
42
|
-
npx
|
|
42
|
+
npx nuxt add plugin sockets --client
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
## `
|
|
45
|
+
## `nuxt add component`
|
|
46
46
|
|
|
47
47
|
* Modifier flags: `--mode client|server` or `--client` or `--server`
|
|
48
48
|
|
|
49
49
|
```bash [Terminal]
|
|
50
50
|
# Generates `components/TheHeader.vue`
|
|
51
|
-
npx
|
|
51
|
+
npx nuxt add component TheHeader
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
## `
|
|
54
|
+
## `nuxt add composable`
|
|
55
55
|
|
|
56
56
|
```bash [Terminal]
|
|
57
57
|
# Generates `composables/foo.ts`
|
|
58
|
-
npx
|
|
58
|
+
npx nuxt add composable foo
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
## `
|
|
61
|
+
## `nuxt add layout`
|
|
62
62
|
|
|
63
63
|
```bash [Terminal]
|
|
64
64
|
# Generates `layouts/custom.vue`
|
|
65
|
-
npx
|
|
65
|
+
npx nuxt add layout custom
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
## `
|
|
68
|
+
## `nuxt add plugin`
|
|
69
69
|
|
|
70
70
|
* Modifier flags: `--mode client|server` or `--client`or `--server`
|
|
71
71
|
|
|
72
72
|
```bash [Terminal]
|
|
73
73
|
# Generates `plugins/analytics.ts`
|
|
74
|
-
npx
|
|
74
|
+
npx nuxt add plugin analytics
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
## `
|
|
77
|
+
## `nuxt add page`
|
|
78
78
|
|
|
79
79
|
```bash [Terminal]
|
|
80
80
|
# Generates `pages/about.vue`
|
|
81
|
-
npx
|
|
81
|
+
npx nuxt add page about
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
```bash [Terminal]
|
|
85
85
|
# Generates `pages/category/[id].vue`
|
|
86
|
-
npx
|
|
86
|
+
npx nuxt add page "category/[id]"
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
## `
|
|
89
|
+
## `nuxt add middleware`
|
|
90
90
|
|
|
91
91
|
* Modifier flags: `--global`
|
|
92
92
|
|
|
93
93
|
```bash [Terminal]
|
|
94
94
|
# Generates `middleware/auth.ts`
|
|
95
|
-
npx
|
|
95
|
+
npx nuxt add middleware auth
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
## `
|
|
98
|
+
## `nuxt add api`
|
|
99
99
|
|
|
100
100
|
* Modifier flags: `--method` (can accept `connect`, `delete`, `get`, `head`, `options`, `patch`, `post`, `put` or `trace`) or alternatively you can directly use `--get`, `--post`, etc.
|
|
101
101
|
|
|
102
102
|
```bash [Terminal]
|
|
103
103
|
# Generates `server/api/hello.ts`
|
|
104
|
-
npx
|
|
104
|
+
npx nuxt add api hello
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
## `
|
|
107
|
+
## `nuxt add layer`
|
|
108
108
|
|
|
109
109
|
```bash [Terminal]
|
|
110
110
|
# Generates `layers/subscribe/nuxt.config.ts`
|
|
111
|
-
npx
|
|
111
|
+
npx nuxt add layer subscribe
|
|
112
112
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt analyze"
|
|
3
3
|
description: "Analyze the production bundle or your Nuxt application."
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--analyze-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt analyze [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dotenv] [--name=<name>] [--no-serve]
|
|
14
14
|
```
|
|
15
15
|
<!--/analyze-cmd-->
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: '
|
|
2
|
+
title: 'nuxt build-module'
|
|
3
3
|
description: 'Nuxt command to build your Nuxt module before publishing.'
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--build-module-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt build-module [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--build] [--stub] [--sourcemap] [--prepare]
|
|
14
14
|
```
|
|
15
15
|
<!--/build-module-cmd-->
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt build"
|
|
3
3
|
description: "Build your Nuxt application."
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--build-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt build [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--prerender] [--preset] [--dotenv] [--envName]
|
|
14
14
|
```
|
|
15
15
|
<!--/build-cmd-->
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: '
|
|
2
|
+
title: 'nuxt cleanup'
|
|
3
3
|
description: 'Remove common generated Nuxt files and caches.'
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--cleanup-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt cleanup [ROOTDIR] [--cwd=<directory>]
|
|
14
14
|
```
|
|
15
15
|
<!--/cleanup-cmd-->
|
|
16
16
|
|
package/3.api/4.commands/dev.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: '
|
|
2
|
+
title: 'nuxt dev'
|
|
3
3
|
description: The dev command starts a development server with hot module replacement at http://localhost:3000
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--dev-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt dev [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dotenv] [--envName] [--no-clear] [--no-fork] [-p, --port] [-h, --host] [--clipboard] [-o, --open] [--https] [--publicURL] [--qr] [--public] [--tunnel] [--sslCert] [--sslKey]
|
|
14
14
|
```
|
|
15
15
|
<!--/dev-cmd-->
|
|
16
16
|
|
|
@@ -50,7 +50,7 @@ Option | Default | Description
|
|
|
50
50
|
|
|
51
51
|
The port and host can also be set via NUXT_PORT, PORT, NUXT_HOST or HOST environment variables.
|
|
52
52
|
|
|
53
|
-
Additionally to the above options, `
|
|
53
|
+
Additionally to the above options, `@nuxt/cli` can pass options through to `listhen`, e.g. `--no-qr` to turn off the dev server QR code. You can find the list of `listhen` options in the [unjs/listhen](https://github.com/unjs/listhen) docs.
|
|
54
54
|
|
|
55
55
|
This command sets `process.env.NODE_ENV` to `development`.
|
|
56
56
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt devtools"
|
|
3
3
|
description: The devtools command allows you to enable or disable Nuxt DevTools on a per-project basis.
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,11 +10,11 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--devtools-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt devtools <COMMAND> [ROOTDIR] [--cwd=<directory>]
|
|
14
14
|
```
|
|
15
15
|
<!--/devtools-cmd-->
|
|
16
16
|
|
|
17
|
-
Running `
|
|
17
|
+
Running `nuxt devtools enable` will install the Nuxt DevTools globally, and also enable it within the particular project you are using. It is saved as a preference in your user-level `.nuxtrc`. If you want to remove devtools support for a particular project, you can run `nuxt devtools disable`.
|
|
18
18
|
|
|
19
19
|
## Arguments
|
|
20
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt generate"
|
|
3
3
|
description: Pre-renders every route of the application and stores the result in plain HTML files.
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,11 +10,11 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--generate-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt generate [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--preset] [--dotenv] [--envName]
|
|
14
14
|
```
|
|
15
15
|
<!--/generate-cmd-->
|
|
16
16
|
|
|
17
|
-
The `generate` command pre-renders every route of your application and stores the result in plain HTML files that you can deploy on any static hosting services. The command triggers the `
|
|
17
|
+
The `generate` command pre-renders every route of your application and stores the result in plain HTML files that you can deploy on any static hosting services. The command triggers the `nuxt build` command with the `prerender` argument set to `true`
|
|
18
18
|
|
|
19
19
|
## Arguments
|
|
20
20
|
|
package/3.api/4.commands/info.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt info"
|
|
3
3
|
description: The info command logs information about the current or specified Nuxt project.
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--info-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt info [ROOTDIR] [--cwd=<directory>]
|
|
14
14
|
```
|
|
15
15
|
<!--/info-cmd-->
|
|
16
16
|
|
package/3.api/4.commands/init.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "create nuxt"
|
|
3
3
|
description: The init command initializes a fresh Nuxt project.
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,11 +10,11 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--init-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
|
|
13
|
+
npm create nuxt@latest [DIR] [--cwd=<directory>] [-t, --template] [-f, --force] [--offline] [--preferOffline] [--no-install] [--gitInit] [--shell] [--packageManager]
|
|
14
14
|
```
|
|
15
15
|
<!--/init-cmd-->
|
|
16
16
|
|
|
17
|
-
The `
|
|
17
|
+
The `create-nuxt` command initializes a fresh Nuxt project using [unjs/giget](https://github.com/unjs/giget).
|
|
18
18
|
|
|
19
19
|
## Arguments
|
|
20
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt module"
|
|
3
3
|
description: "Search and add modules to your Nuxt application with the command line."
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -8,13 +8,13 @@ links:
|
|
|
8
8
|
size: xs
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Nuxt provides a few utilities to work with [Nuxt modules](/modules) seamlessly.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## nuxt module add
|
|
14
14
|
|
|
15
15
|
<!--module-add-cmd-->
|
|
16
16
|
```bash [Terminal]
|
|
17
|
-
npx
|
|
17
|
+
npx nuxt module add <MODULENAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--skipInstall] [--skipConfig] [--dev]
|
|
18
18
|
```
|
|
19
19
|
<!--/module-add-cmd-->
|
|
20
20
|
|
|
@@ -47,14 +47,14 @@ When running the command, it will:
|
|
|
47
47
|
Installing the [`Pinia`](/modules/pinia) module
|
|
48
48
|
|
|
49
49
|
```bash [Terminal]
|
|
50
|
-
npx
|
|
50
|
+
npx nuxt module add pinia
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## nuxt module search
|
|
54
54
|
|
|
55
55
|
<!--module-search-cmd-->
|
|
56
56
|
```bash [Terminal]
|
|
57
|
-
npx
|
|
57
|
+
npx nuxt module search <QUERY> [--cwd=<directory>] [--nuxtVersion=<2|3>]
|
|
58
58
|
```
|
|
59
59
|
<!--/module-search-cmd-->
|
|
60
60
|
|
|
@@ -80,5 +80,5 @@ The command searches for Nuxt modules matching your query that are compatible wi
|
|
|
80
80
|
**Example:**
|
|
81
81
|
|
|
82
82
|
```bash [Terminal]
|
|
83
|
-
npx
|
|
83
|
+
npx nuxt module search pinia
|
|
84
84
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: '
|
|
2
|
+
title: 'nuxt prepare'
|
|
3
3
|
description: The prepare command creates a .nuxt directory in your application and generates types.
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--prepare-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt prepare [ROOTDIR] [--dotenv] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--envName]
|
|
14
14
|
```
|
|
15
15
|
<!--/prepare-cmd-->
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt preview"
|
|
3
3
|
description: The preview command starts a server to preview your application after the build command.
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--preview-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt preview [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--envName] [--dotenv] [-p, --port]
|
|
14
14
|
```
|
|
15
15
|
<!--/preview-cmd-->
|
|
16
16
|
|
|
@@ -39,5 +39,5 @@ Option | Default | Description
|
|
|
39
39
|
This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a `.env` file or as command-line argument.
|
|
40
40
|
|
|
41
41
|
::note
|
|
42
|
-
For convenience, in preview mode, your [`.env`](/docs/guide/directory-structure/env) file will be loaded into `process.env`. (However, in production you will need to ensure your environment variables are set yourself.)
|
|
42
|
+
For convenience, in preview mode, your [`.env`](/docs/guide/directory-structure/env) file will be loaded into `process.env`. (However, in production you will need to ensure your environment variables are set yourself. For example, with Node.js 20+ you could do this by running `node --env-file .env .output/server/index.mjs` to start your server.)
|
|
43
43
|
::
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt typecheck"
|
|
3
3
|
description: The typecheck command runs vue-tsc to check types throughout your app.
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--typecheck-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt typecheck [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>]
|
|
14
14
|
```
|
|
15
15
|
<!--/typecheck-cmd-->
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "nuxt upgrade"
|
|
3
3
|
description: The upgrade command upgrades Nuxt to the latest version.
|
|
4
4
|
links:
|
|
5
5
|
- label: Source
|
|
@@ -10,7 +10,7 @@ links:
|
|
|
10
10
|
|
|
11
11
|
<!--upgrade-cmd-->
|
|
12
12
|
```bash [Terminal]
|
|
13
|
-
npx
|
|
13
|
+
npx nuxt upgrade [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dedupe] [-f, --force] [-ch, --channel=<stable|nightly>]
|
|
14
14
|
```
|
|
15
15
|
<!--/upgrade-cmd-->
|
|
16
16
|
|
package/3.api/5.kit/11.nitro.md
CHANGED
|
@@ -117,7 +117,7 @@ export default defineNuxtModule({
|
|
|
117
117
|
|
|
118
118
|
```ts twoslash
|
|
119
119
|
// @errors: 2391
|
|
120
|
-
import type { NitroDevEventHandler } from 'nitropack'
|
|
120
|
+
import type { NitroDevEventHandler } from 'nitropack/types'
|
|
121
121
|
// ---cut---
|
|
122
122
|
function addDevServerHandler (handler: NitroDevEventHandler): void
|
|
123
123
|
```
|
package/3.api/5.kit/7.pages.md
CHANGED
|
@@ -68,7 +68,7 @@ Hook | Arguments | Description
|
|
|
68
68
|
`nitro:build:public-assets` | `nitro` | Called after copying public assets. Allows modifying public assets before Nitro server is built.
|
|
69
69
|
`prerender:routes` | `ctx` | Allows extending the routes to be pre-rendered.
|
|
70
70
|
`build:error` | `error` | Called when an error occurs at build time.
|
|
71
|
-
`prepare:types` | `options` | Called before
|
|
71
|
+
`prepare:types` | `options` | Called before `@nuxt/cli` writes `.nuxt/tsconfig.json` and `.nuxt/nuxt.d.ts`, allowing addition of custom references and declarations in `nuxt.d.ts`, or directly modifying the options in `tsconfig.json`
|
|
72
72
|
`listen` | `listenerServer, listener` | Called when the dev server is loading.
|
|
73
73
|
`schema:extend` | `schemas` | Allows extending default schemas.
|
|
74
74
|
`schema:resolved` | `schema` | Allows extending resolved schema.
|