@nuxt/docs-nightly 5.0.0-29837393.f0553e4c → 5.0.0-29837688.ef8d0fbb
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/15.prerendering.md +1 -1
- package/3.guide/5.recipes/1.custom-routing.md +1 -1
- package/3.guide/6.going-further/1.experimental-features.md +10 -20
- package/3.guide/6.going-further/1.features.md +2 -16
- package/4.api/2.composables/use-server-seo-meta.md +1 -1
- package/4.api/3.utils/clear-nuxt-state.md +1 -1
- package/4.api/6.advanced/2.import-meta.md +1 -1
- package/4.api/6.nuxt-config.md +11 -0
- package/package.json +1 -1
|
@@ -158,7 +158,7 @@ You can control this behavior with the [`experimental.payloadExtraction`](/docs/
|
|
|
158
158
|
- `true` - The payload is extracted to a separate `_payload.json` file for both the initial render and client-side navigation. The HTML is smaller and the payload file can be cached by a CDN, at the cost of one extra request on first load.
|
|
159
159
|
- `false` - Payload extraction is disabled. The payload is always inlined in the HTML and no `_payload.json` files are generated.
|
|
160
160
|
|
|
161
|
-
The default is `
|
|
161
|
+
The default is `'client'`. It is forced to `false` when `ssr: false` is set.
|
|
162
162
|
|
|
163
163
|
```ts twoslash [nuxt.config.ts]
|
|
164
164
|
export default defineNuxtConfig({
|
|
@@ -138,7 +138,7 @@ export default defineNuxtConfig({
|
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
::note
|
|
141
|
-
|
|
141
|
+
Routing is case-sensitive by default to match Nitro. Set `router.options.sensitive` to `false` to opt out.
|
|
142
142
|
::
|
|
143
143
|
|
|
144
144
|
### Hash Mode (SPA)
|
|
@@ -193,23 +193,14 @@ export default defineNuxtConfig({
|
|
|
193
193
|
## parseErrorData
|
|
194
194
|
|
|
195
195
|
::warning
|
|
196
|
-
This option is deprecated and will be removed.
|
|
196
|
+
This option is deprecated and will be removed. It is forced on and setting it is ignored.
|
|
197
197
|
::
|
|
198
198
|
|
|
199
199
|
Whether to parse `error.data` when rendering a server error page.
|
|
200
200
|
|
|
201
201
|
It existed because the error was previously passed to the error page as individual query parameters, which stringified `error.data` and meant it had to be parsed back. Setting it to `false` opted out of that parsing and left you with the string.
|
|
202
202
|
|
|
203
|
-
The error is now JSON-encoded as a whole, so `error.data` arrives with its original shape and is never stringified.
|
|
204
|
-
|
|
205
|
-
```ts twoslash [nuxt.config.ts]
|
|
206
|
-
export default defineNuxtConfig({
|
|
207
|
-
future: { compatibilityVersion: 4 },
|
|
208
|
-
experimental: {
|
|
209
|
-
parseErrorData: false,
|
|
210
|
-
},
|
|
211
|
-
})
|
|
212
|
-
```
|
|
203
|
+
The error is now JSON-encoded as a whole, so `error.data` arrives with its original shape and is never stringified.
|
|
213
204
|
|
|
214
205
|
## payloadExtraction
|
|
215
206
|
|
|
@@ -219,7 +210,7 @@ Controls how payload data is delivered for prerendered and cached (ISR/SWR) page
|
|
|
219
210
|
- `true` - Payload is extracted to a separate `_payload.json` file for both the initial server render and client-side navigation.
|
|
220
211
|
- `false` - Payload extraction is disabled entirely. Payload is always inlined in HTML and no `_payload.json` files are generated.
|
|
221
212
|
|
|
222
|
-
The default is `
|
|
213
|
+
The default is `'client'`. It is forced to `false` when `ssr: false` is set.
|
|
223
214
|
|
|
224
215
|
```ts twoslash [nuxt.config.ts]
|
|
225
216
|
export default defineNuxtConfig({
|
|
@@ -243,12 +234,12 @@ When enabled, `.client.vue` components and `createClientOnly()` wrappers render
|
|
|
243
234
|
Enabling this means attributes (`class`, `style`, etc.) passed to `.client.vue` components will not appear in the SSR HTML. If you need styled placeholders to prevent layout shift, use `<ClientOnly>` with a `#fallback` slot instead.
|
|
244
235
|
::
|
|
245
236
|
|
|
246
|
-
This flag is enabled
|
|
237
|
+
This flag is enabled by default, but you can disable it:
|
|
247
238
|
|
|
248
239
|
```ts twoslash [nuxt.config.ts]
|
|
249
240
|
export default defineNuxtConfig({
|
|
250
241
|
experimental: {
|
|
251
|
-
clientNodePlaceholder:
|
|
242
|
+
clientNodePlaceholder: false,
|
|
252
243
|
},
|
|
253
244
|
})
|
|
254
245
|
```
|
|
@@ -478,8 +469,7 @@ You can also set this to `chokidar` to watch all files in your source directory.
|
|
|
478
469
|
|
|
479
470
|
Set to `'builder'` to reuse the active builder's own file watcher (for example,
|
|
480
471
|
Vite's `server.watcher`) instead of starting a second one. This reduces the
|
|
481
|
-
number of file watchers active in dev mode and
|
|
482
|
-
`future.compatibilityVersion` is `5`. If the active builder does not implement
|
|
472
|
+
number of file watchers active in dev mode and is the default. If the active builder does not implement
|
|
483
473
|
its own watcher (currently webpack and rspack), Nuxt logs a warning and falls
|
|
484
474
|
back to its default selection.
|
|
485
475
|
|
|
@@ -656,7 +646,7 @@ This allows modules to access additional metadata from the page metadata in the
|
|
|
656
646
|
|
|
657
647
|
## extractSerializablePageMeta
|
|
658
648
|
|
|
659
|
-
Enabled by default
|
|
649
|
+
Enabled by default.
|
|
660
650
|
|
|
661
651
|
By default, Nuxt only reads a fixed list of `definePageMeta()` keys at build time (plus anything in `extraPageMetaExtractionKeys`); everything else is resolved at runtime from a separate module generated per page. With this option, Nuxt writes every JSON-serializable property straight into the generated route record instead.
|
|
662
652
|
|
|
@@ -705,7 +695,7 @@ Transform top-level `await navigateTo()` calls in `<script setup>` into an early
|
|
|
705
695
|
|
|
706
696
|
Without this flag, code after `await navigateTo()` continues to run, which can result in later code (including subsequent `navigateTo` calls) overriding the redirect or attempting to render a page with missing data. With this flag enabled, a successful navigation stops execution of the rest of your setup code and the component renders a placeholder comment while the navigation proceeds.
|
|
707
697
|
|
|
708
|
-
This flag is enabled by default
|
|
698
|
+
This flag is enabled by default, but you can disable it:
|
|
709
699
|
|
|
710
700
|
```ts twoslash [nuxt.config.ts]
|
|
711
701
|
export default defineNuxtConfig({
|
|
@@ -773,7 +763,7 @@ By default, Vue assigns component names based on the filename. For example, `pag
|
|
|
773
763
|
|
|
774
764
|
With `normalizePageNames` enabled, page components are named after their route (e.g. `foo` and `bar`), so you can use `<KeepAlive>` with `include`/`exclude` without manually adding `defineOptions({ name: '...' })` to each page.
|
|
775
765
|
|
|
776
|
-
This flag is enabled
|
|
766
|
+
This flag is enabled by default, but you can disable this feature:
|
|
777
767
|
|
|
778
768
|
```ts twoslash [nuxt.config.ts]
|
|
779
769
|
export default defineNuxtConfig({
|
|
@@ -992,7 +982,7 @@ export default defineNuxtConfig({
|
|
|
992
982
|
})
|
|
993
983
|
```
|
|
994
984
|
|
|
995
|
-
The `useState.resetOnClear` option controls whether [`clearNuxtState`](/docs/api/utils/clear-nuxt-state) resets state to its initial value (provided by the `init` function of [`useState`](/docs/api/composables/use-state)) instead of setting it to `undefined`. This defaults to `true
|
|
985
|
+
The `useState.resetOnClear` option controls whether [`clearNuxtState`](/docs/api/utils/clear-nuxt-state) resets state to its initial value (provided by the `init` function of [`useState`](/docs/api/composables/use-state)) instead of setting it to `undefined`. This defaults to `true`.
|
|
996
986
|
|
|
997
987
|
## purgeCachedData
|
|
998
988
|
|
|
@@ -95,22 +95,8 @@ See the mostly-static site recipe for combining `noScripts` with prerendering, i
|
|
|
95
95
|
|
|
96
96
|
There is also a `future` namespace for early opting-in to new features that will become default in a future (possibly major) version of the framework.
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
This enables early access to Nuxt features or flags.
|
|
101
|
-
|
|
102
|
-
On Nuxt 5 it resolves to `5`, and the defaults described in the upgrade guide apply. Individual changes are configured through the options named there rather than through this one.
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
export default defineNuxtConfig({
|
|
106
|
-
future: {
|
|
107
|
-
compatibilityVersion: 5,
|
|
108
|
-
},
|
|
109
|
-
})
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
::read-more{to="/docs/getting-started/upgrade#migrating-to-nuxt-5"}
|
|
113
|
-
Learn more about migrating to Nuxt 5.
|
|
98
|
+
::note
|
|
99
|
+
`future.compatibilityVersion` always resolves to `5` in Nuxt 5. To opt into Nuxt 5 behaviour on Nuxt 4, see the [Nuxt 4 documentation](https://nuxt.com/docs/4.x/getting-started/upgrade#testing-nuxt-5).
|
|
114
100
|
::
|
|
115
101
|
|
|
116
102
|
### multiApp
|
|
@@ -9,7 +9,7 @@ links:
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
::warning
|
|
12
|
-
`useServerSeoMeta` is deprecated. Wrap [`useSeoMeta`](/docs/api/composables/use-seo-meta) in an `if (import.meta.server)` block instead.
|
|
12
|
+
`useServerSeoMeta` is deprecated. Wrap [`useSeoMeta`](/docs/api/composables/use-seo-meta) in an `if (import.meta.server)` block instead. It is no longer auto-imported.
|
|
13
13
|
::
|
|
14
14
|
|
|
15
15
|
`useServerSeoMeta` lets you define your site's SEO meta tags as a flat object with full TypeScript support, exactly like [`useSeoMeta`](/docs/api/composables/use-seo-meta), but it only runs server-side and is tree-shaken from the client bundle.
|
|
@@ -23,4 +23,4 @@ export function clearNuxtState (keys?: string | string[] | ((key: string) => boo
|
|
|
23
23
|
|
|
24
24
|
- `keys`: One or an array of keys that are used in [`useState`](/docs/api/composables/use-state) to delete their cached state. If no keys are provided, **all state** will be invalidated.
|
|
25
25
|
- `opts`: An options object to configure the clear behavior.
|
|
26
|
-
- `reset` :badge[v4.4]{color="info" size="xs" class="align-middle"}: When set to `true`, resets the state to the initial value provided by the `init` function of [`useState`](/docs/api/composables/use-state) instead of setting it to `undefined`. When not specified, defaults to the value of `experimental.defaults.useState.resetOnClear` in your Nuxt config (which
|
|
26
|
+
- `reset` :badge[v4.4]{color="info" size="xs" class="align-middle"}: When set to `true`, resets the state to the initial value provided by the `init` function of [`useState`](/docs/api/composables/use-state) instead of setting it to `undefined`. When not specified, defaults to the value of `experimental.defaults.useState.resetOnClear` in your Nuxt config (which defaults to `true`).
|
|
@@ -19,7 +19,7 @@ Read more about `import.meta`.
|
|
|
19
19
|
These values are statically injected and can be used for tree-shaking your runtime code.
|
|
20
20
|
|
|
21
21
|
::note
|
|
22
|
-
`process.browser`, `process.client`, `process.dev`, `process.server`, and `process.test` were soft-deprecated in Nuxt 3.12. In Nuxt 5
|
|
22
|
+
`process.browser`, `process.client`, `process.dev`, `process.server`, and `process.test` were soft-deprecated in Nuxt 3.12. In Nuxt 5, Nuxt no longer augments `NodeJS.Process` with those properties. Prefer the matching `import.meta.*` flags; build-time `process.*` defines still exist for compatibility.
|
|
23
23
|
::
|
|
24
24
|
|
|
25
25
|
Property | Type | Description
|
package/4.api/6.nuxt-config.md
CHANGED
|
@@ -1605,6 +1605,17 @@ If set to true, this will type check in development. You can restrict this to bu
|
|
|
1605
1605
|
|
|
1606
1606
|
**See**: [Nuxt TypeScript docs](/docs/guide/concepts/typescript)
|
|
1607
1607
|
|
|
1608
|
+
## typesDir
|
|
1609
|
+
|
|
1610
|
+
Define the directory where generated types and `tsconfig.json` files will be placed.
|
|
1611
|
+
|
|
1612
|
+
This defaults to your `buildDir`, and is separate from it so that the configurations referenced by your project `tsconfig.json` stay in place even when Nuxt builds elsewhere (as it does when building a project that has already been run in development).
|
|
1613
|
+
|
|
1614
|
+
If a relative path is specified, it will be relative to your `rootDir`.
|
|
1615
|
+
|
|
1616
|
+
- **Type**: `string`
|
|
1617
|
+
- **Default:** `"/<rootDir>/.nuxt"`
|
|
1618
|
+
|
|
1608
1619
|
## unhead
|
|
1609
1620
|
|
|
1610
1621
|
An object that allows us to configure the `unhead` nuxt module.
|