docs: add missing export defaults for nuxt config (#25774)

This commit is contained in:
Eduardo San Martin Morote 2024-02-13 15:35:48 +01:00 committed by GitHub
parent b40e9dc3c7
commit 2000990e76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 26 deletions

View File

@ -16,7 +16,7 @@ Note that these features are experimental and could be removed or modified in th
Enable native async context to be accessible for nested composables in Nuxt and in Nitro. This opens the possibility to use composables inside async composables and reduce the chance to get the `Nuxt instance is unavailable` error. Enable native async context to be accessible for nested composables in Nuxt and in Nitro. This opens the possibility to use composables inside async composables and reduce the chance to get the `Nuxt instance is unavailable` error.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
asyncContext: true asyncContext: true
} }
@ -32,7 +32,7 @@ See full explanation on the GitHub pull-request.
Enables generation of an async entry point for the Vue bundle, aiding module federation support. Enables generation of an async entry point for the Vue bundle, aiding module federation support.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
asyncEntry: true asyncEntry: true
} }
@ -46,7 +46,7 @@ Externalizes `vue`, `@vue/*` and `vue-router` when building.
*Enabled by default.* *Enabled by default.*
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
externalVue: true externalVue: true
} }
@ -64,7 +64,7 @@ Tree shakes contents of client-only components from server bundle.
*Enabled by default.* *Enabled by default.*
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
treeshakeClientOnly: true treeshakeClientOnly: true
} }
@ -78,7 +78,7 @@ Emits `app:chunkError` hook when there is an error loading vite/webpack chunks.
You can disable automatic handling by setting this to `false`, or handle chunk errors manually by setting it to `manual`. You can disable automatic handling by setting this to `false`, or handle chunk errors manually by setting it to `manual`.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
emitRouteChunkError: 'automatic' // or 'manual' or false emitRouteChunkError: 'automatic' // or 'manual' or false
} }
@ -97,7 +97,7 @@ and consider providing explicit keys to [`useState`](/docs/api/composables/use-s
:: ::
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
restoreState: true restoreState: true
} }
@ -109,7 +109,7 @@ export defineNuxtConfig({
Define route rules at the page level using [`defineRouteRules`](/docs/api/utils/define-route-rules). Define route rules at the page level using [`defineRouteRules`](/docs/api/utils/define-route-rules).
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
inlineRouteRules: true inlineRouteRules: true
} }
@ -131,7 +131,7 @@ Allows rendering of JSON payloads with support for revivifying complex types.
*Enabled by default.* *Enabled by default.*
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
renderJsonPayloads: true renderJsonPayloads: true
} }
@ -143,7 +143,7 @@ export defineNuxtConfig({
Disables Vue server renderer endpoint within Nitro. Disables Vue server renderer endpoint within Nitro.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
noVueServer: true noVueServer: true
} }
@ -155,7 +155,7 @@ export defineNuxtConfig({
Enables extraction of payloads of pages generated with `nuxt generate`. Enables extraction of payloads of pages generated with `nuxt generate`.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
payloadExtraction: true payloadExtraction: true
} }
@ -167,7 +167,7 @@ export defineNuxtConfig({
Enables the experimental [`<NuxtClientFallback>`](/docs/api/components/nuxt-client-fallback) component for rendering content on the client if there's an error in SSR. Enables the experimental [`<NuxtClientFallback>`](/docs/api/components/nuxt-client-fallback) component for rendering content on the client if there's an error in SSR.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
clientFallback: true clientFallback: true
} }
@ -179,7 +179,7 @@ export defineNuxtConfig({
Enables cross-origin prefetch using the Speculation Rules API. Enables cross-origin prefetch using the Speculation Rules API.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
crossOriginPrefetch: true crossOriginPrefetch: true
} }
@ -195,7 +195,7 @@ Read more about the **Speculation Rules API**.
Enables View Transition API integration with client-side router. Enables View Transition API integration with client-side router.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
viewTransition: true viewTransition: true
} }
@ -213,7 +213,7 @@ Read more about the **View Transition API**.
Enables writing of early hints when using node server. Enables writing of early hints when using node server.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
writeEarlyHints: true writeEarlyHints: true
} }
@ -225,7 +225,7 @@ export defineNuxtConfig({
Enables experimental component islands support with [`<NuxtIsland>`](/docs/api/components/nuxt-island) and `.island.vue` files. Enables experimental component islands support with [`<NuxtIsland>`](/docs/api/components/nuxt-island) and `.island.vue` files.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
componentIslands: true // false or 'local+remote' componentIslands: true // false or 'local+remote'
} }
@ -245,7 +245,7 @@ Enables config schema support.
*Enabled by default.* *Enabled by default.*
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
configSchema: true configSchema: true
} }
@ -257,7 +257,7 @@ export defineNuxtConfig({
Adds a compatibility layer for modules, plugins, or user code relying on the old `@vueuse/head` API. Adds a compatibility layer for modules, plugins, or user code relying on the old `@vueuse/head` API.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
polyfillVueUseHead: false polyfillVueUseHead: false
} }
@ -269,7 +269,7 @@ export defineNuxtConfig({
Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header. Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
respectNoSSRHeader: false respectNoSSRHeader: false
} }
@ -283,7 +283,7 @@ Resolve `~`, `~~`, `@` and `@@` aliases located within layers with respect to th
*Enabled by default.* *Enabled by default.*
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
localLayerAliases: true localLayerAliases: true
} }
@ -295,7 +295,7 @@ export defineNuxtConfig({
Enable the new experimental typed router using [`unplugin-vue-router`](https://github.com/posva/unplugin-vue-router). Enable the new experimental typed router using [`unplugin-vue-router`](https://github.com/posva/unplugin-vue-router).
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
typedPages: true typedPages: true
} }
@ -319,7 +319,7 @@ performance in large projects or on Windows platforms.
You can also set this to `chokidar` to watch all files in your source directory. You can also set this to `chokidar` to watch all files in your source directory.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
watcher: 'chokidar-granular' // 'chokidar' or 'parcel' are also options watcher: 'chokidar-granular' // 'chokidar' or 'parcel' are also options
} }
@ -333,7 +333,7 @@ in a significant performance improvement when prerendering sites that use `useAs
fetch the same data in different pages. fetch the same data in different pages.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
sharedPrerenderData: true sharedPrerenderData: true
} }
@ -383,7 +383,7 @@ This only works with static or strings/arrays rather than variables or condition
Enables CookieStore support to listen for cookie updates (if supported by the browser) and refresh `useCookie` ref values. Enables CookieStore support to listen for cookie updates (if supported by the browser) and refresh `useCookie` ref values.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
experimental: { experimental: {
cookieStore: true cookieStore: true
} }

View File

@ -14,7 +14,7 @@ Inlines styles when rendering HTML. This is currently available only when using
You can also pass a function that receives the path of a Vue component and returns a boolean indicating whether to inline the styles for that component. You can also pass a function that receives the path of a Vue component and returns a boolean indicating whether to inline the styles for that component.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
features: { features: {
inlineStyles: true // or a function to determine inlining inlineStyles: true // or a function to determine inlining
} }
@ -26,7 +26,7 @@ export defineNuxtConfig({
Disables rendering of Nuxt scripts and JS resource hints. Can also be configured granularly within `routeRules`. Disables rendering of Nuxt scripts and JS resource hints. Can also be configured granularly within `routeRules`.
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
features: { features: {
noScripts: true noScripts: true
} }
@ -47,7 +47,7 @@ It improves type support when using modern libraries with `exports`.
See [the original TypeScript pull request](https://github.com/microsoft/TypeScript/pull/51669). See [the original TypeScript pull request](https://github.com/microsoft/TypeScript/pull/51669).
```ts [nuxt.config.ts] ```ts [nuxt.config.ts]
export defineNuxtConfig({ export default defineNuxtConfig({
future: { future: {
typescriptBundlerResolution: true typescriptBundlerResolution: true
} }