Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix export config #25774

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 23 additions & 23 deletions docs/2.guide/3.going-further/1.experimental-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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'
}
Expand All @@ -245,7 +245,7 @@ Enables config schema support.
*Enabled by default.*

```ts [nuxt.config.ts]
export defineNuxtConfig({
export default defineNuxtConfig({
experimental: {
configSchema: true
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions docs/2.guide/3.going-further/1.features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down