mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
docs: add missing export defaults for nuxt config (#25774)
This commit is contained in:
parent
b40e9dc3c7
commit
2000990e76
@ -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.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
asyncEntry: true
|
||||
}
|
||||
@ -46,7 +46,7 @@ Externalizes `vue`, `@vue/*` and `vue-router` when building.
|
||||
*Enabled by default.*
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
externalVue: true
|
||||
}
|
||||
@ -64,7 +64,7 @@ Tree shakes contents of client-only components from server bundle.
|
||||
*Enabled by default.*
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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`.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
restoreState: true
|
||||
}
|
||||
@ -109,7 +109,7 @@ export defineNuxtConfig({
|
||||
Define route rules at the page level using [`defineRouteRules`](/docs/api/utils/define-route-rules).
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
inlineRouteRules: true
|
||||
}
|
||||
@ -131,7 +131,7 @@ Allows rendering of JSON payloads with support for revivifying complex types.
|
||||
*Enabled by default.*
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
renderJsonPayloads: true
|
||||
}
|
||||
@ -143,7 +143,7 @@ export defineNuxtConfig({
|
||||
Disables Vue server renderer endpoint within Nitro.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
noVueServer: true
|
||||
}
|
||||
@ -155,7 +155,7 @@ export defineNuxtConfig({
|
||||
Enables extraction of payloads of pages generated with `nuxt generate`.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
clientFallback: true
|
||||
}
|
||||
@ -179,7 +179,7 @@ export defineNuxtConfig({
|
||||
Enables cross-origin prefetch using the Speculation Rules API.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
crossOriginPrefetch: true
|
||||
}
|
||||
@ -195,7 +195,7 @@ Read more about the **Speculation Rules API**.
|
||||
Enables View Transition API integration with client-side router.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
viewTransition: true
|
||||
}
|
||||
@ -213,7 +213,7 @@ Read more about the **View Transition API**.
|
||||
Enables writing of early hints when using node server.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
writeEarlyHints: true
|
||||
}
|
||||
@ -225,7 +225,7 @@ export defineNuxtConfig({
|
||||
Enables experimental component islands support with [`<NuxtIsland>`](/docs/api/components/nuxt-island) and `.island.vue` files.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
componentIslands: true // false or 'local+remote'
|
||||
}
|
||||
@ -245,7 +245,7 @@ Enables config schema support.
|
||||
*Enabled by default.*
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
polyfillVueUseHead: false
|
||||
}
|
||||
@ -269,7 +269,7 @@ export defineNuxtConfig({
|
||||
Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
respectNoSSRHeader: false
|
||||
}
|
||||
@ -283,7 +283,7 @@ Resolve `~`, `~~`, `@` and `@@` aliases located within layers with respect to th
|
||||
*Enabled by default.*
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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).
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
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.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
cookieStore: true
|
||||
}
|
||||
|
@ -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.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
features: {
|
||||
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`.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
features: {
|
||||
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).
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export defineNuxtConfig({
|
||||
export default defineNuxtConfig({
|
||||
future: {
|
||||
typescriptBundlerResolution: true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user