@nuxt/docs 3.20.2 → 3.21.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.
Files changed (188) hide show
  1. package/1.getting-started/01.introduction.md +4 -4
  2. package/1.getting-started/02.installation.md +4 -7
  3. package/1.getting-started/03.configuration.md +29 -29
  4. package/1.getting-started/04.views.md +6 -4
  5. package/1.getting-started/05.assets.md +2 -2
  6. package/1.getting-started/06.styling.md +22 -16
  7. package/1.getting-started/07.routing.md +6 -6
  8. package/1.getting-started/08.seo-meta.md +8 -4
  9. package/1.getting-started/09.transitions.md +6 -6
  10. package/1.getting-started/10.data-fetching.md +18 -18
  11. package/1.getting-started/11.state-management.md +5 -5
  12. package/1.getting-started/12.error-handling.md +25 -19
  13. package/1.getting-started/13.server.md +9 -9
  14. package/1.getting-started/14.layers.md +49 -15
  15. package/1.getting-started/15.prerendering.md +18 -4
  16. package/1.getting-started/16.deployment.md +2 -1
  17. package/1.getting-started/17.testing.md +17 -7
  18. package/1.getting-started/18.upgrade.md +111 -60
  19. package/2.directory-structure/0.output.md +1 -1
  20. package/2.directory-structure/1.assets.md +1 -1
  21. package/2.directory-structure/1.components.md +12 -8
  22. package/2.directory-structure/1.composables.md +2 -2
  23. package/2.directory-structure/1.content.md +1 -1
  24. package/2.directory-structure/1.layers.md +87 -0
  25. package/2.directory-structure/1.layouts.md +35 -3
  26. package/2.directory-structure/1.middleware.md +7 -7
  27. package/2.directory-structure/1.modules.md +8 -2
  28. package/2.directory-structure/1.node_modules.md +1 -1
  29. package/2.directory-structure/1.pages.md +39 -18
  30. package/2.directory-structure/1.plugins.md +4 -1
  31. package/2.directory-structure/1.public.md +1 -1
  32. package/2.directory-structure/1.server.md +28 -8
  33. package/2.directory-structure/1.shared.md +3 -3
  34. package/2.directory-structure/1.utils.md +2 -2
  35. package/2.directory-structure/2.env.md +3 -3
  36. package/2.directory-structure/2.nuxtignore.md +1 -0
  37. package/2.directory-structure/2.nuxtrc.md +5 -2
  38. package/2.directory-structure/3.app-config.md +2 -2
  39. package/2.directory-structure/3.app.md +3 -3
  40. package/2.directory-structure/3.error.md +9 -5
  41. package/2.directory-structure/3.nuxt-config.md +1 -1
  42. package/2.directory-structure/3.package.md +1 -1
  43. package/2.directory-structure/3.tsconfig.md +3 -2
  44. package/2.directory-structure/index.md +12 -8
  45. package/3.guide/0.index.md +5 -2
  46. package/3.guide/1.concepts/{3.rendering.md → 1.rendering.md} +11 -32
  47. package/3.guide/1.concepts/{2.vuejs-development.md → 10.vuejs-development.md} +9 -8
  48. package/3.guide/1.concepts/{10.nuxt-lifecycle.md → 2.nuxt-lifecycle.md} +31 -24
  49. package/3.guide/1.concepts/{1.auto-imports.md → 3.auto-imports.md} +6 -6
  50. package/3.guide/1.concepts/4.server-engine.md +2 -2
  51. package/3.guide/1.concepts/5.modules.md +14 -1
  52. package/3.guide/1.concepts/7.esm.md +5 -4
  53. package/3.guide/1.concepts/8.typescript.md +9 -15
  54. package/3.guide/1.concepts/9.code-style.md +1 -1
  55. package/3.guide/2.best-practices/hydration.md +1 -1
  56. package/3.guide/2.best-practices/performance.md +5 -5
  57. package/3.guide/3.ai/.navigation.yml +3 -0
  58. package/3.guide/3.ai/1.mcp.md +277 -0
  59. package/3.guide/3.ai/2.llms-txt.md +65 -0
  60. package/3.guide/4.modules/.navigation.yml +3 -0
  61. package/3.guide/4.modules/1.getting-started.md +103 -0
  62. package/3.guide/4.modules/2.module-anatomy.md +138 -0
  63. package/3.guide/4.modules/3.recipes-basics.md +420 -0
  64. package/3.guide/4.modules/4.recipes-advanced.md +243 -0
  65. package/3.guide/4.modules/5.testing.md +76 -0
  66. package/3.guide/4.modules/6.best-practices.md +104 -0
  67. package/3.guide/4.modules/7.ecosystem.md +32 -0
  68. package/3.guide/4.modules/index.md +36 -0
  69. package/3.guide/{3.recipes → 5.recipes}/1.custom-routing.md +3 -3
  70. package/3.guide/{3.recipes → 5.recipes}/2.vite-plugin.md +4 -0
  71. package/3.guide/{3.recipes → 5.recipes}/3.custom-usefetch.md +2 -2
  72. package/3.guide/{3.recipes → 5.recipes}/4.sessions-and-authentication.md +3 -3
  73. package/3.guide/{4.going-further → 6.going-further}/1.events.md +3 -4
  74. package/3.guide/{4.going-further → 6.going-further}/1.experimental-features.md +211 -86
  75. package/3.guide/6.going-further/1.features.md +108 -0
  76. package/3.guide/{4.going-further → 6.going-further}/1.internals.md +4 -3
  77. package/3.guide/{4.going-further → 6.going-further}/10.runtime-config.md +2 -2
  78. package/3.guide/{4.going-further → 6.going-further}/11.nightly-release-channel.md +1 -1
  79. package/3.guide/{4.going-further → 6.going-further}/2.hooks.md +5 -5
  80. package/3.guide/{4.going-further → 6.going-further}/4.kit.md +3 -3
  81. package/3.guide/{4.going-further → 6.going-further}/6.nuxt-app.md +6 -6
  82. package/3.guide/{4.going-further → 6.going-further}/7.layers.md +31 -5
  83. package/3.guide/{4.going-further → 6.going-further}/9.debugging.md +3 -2
  84. package/4.api/1.components/1.nuxt-client-fallback.md +5 -1
  85. package/4.api/1.components/10.nuxt-picture.md +1 -1
  86. package/4.api/1.components/11.teleports.md +2 -2
  87. package/4.api/1.components/12.nuxt-route-announcer.md +0 -2
  88. package/4.api/1.components/13.nuxt-time.md +0 -2
  89. package/4.api/1.components/2.nuxt-page.md +3 -3
  90. package/4.api/1.components/3.nuxt-layout.md +6 -6
  91. package/4.api/1.components/4.nuxt-link.md +13 -13
  92. package/4.api/1.components/5.nuxt-loading-indicator.md +1 -1
  93. package/4.api/1.components/6.nuxt-error-boundary.md +2 -2
  94. package/4.api/1.components/7.nuxt-welcome.md +2 -2
  95. package/4.api/1.components/8.nuxt-island.md +9 -2
  96. package/4.api/2.composables/use-app-config.md +1 -1
  97. package/4.api/2.composables/use-async-data.md +5 -5
  98. package/4.api/2.composables/use-cookie.md +16 -16
  99. package/4.api/2.composables/use-error.md +3 -3
  100. package/4.api/2.composables/use-fetch.md +37 -37
  101. package/4.api/2.composables/use-head-safe.md +1 -1
  102. package/4.api/2.composables/use-head.md +22 -7
  103. package/4.api/2.composables/use-lazy-async-data.md +1 -1
  104. package/4.api/2.composables/use-lazy-fetch.md +9 -9
  105. package/4.api/2.composables/use-nuxt-app.md +9 -7
  106. package/4.api/2.composables/use-route-announcer.md +1 -3
  107. package/4.api/2.composables/use-route.md +2 -2
  108. package/4.api/2.composables/use-router.md +15 -15
  109. package/4.api/2.composables/use-runtime-config.md +5 -5
  110. package/4.api/2.composables/use-seo-meta.md +2 -2
  111. package/4.api/2.composables/use-server-seo-meta.md +2 -2
  112. package/4.api/2.composables/use-state.md +12 -2
  113. package/4.api/3.utils/$fetch.md +1 -1
  114. package/4.api/3.utils/abort-navigation.md +2 -2
  115. package/4.api/3.utils/call-once.md +2 -4
  116. package/4.api/3.utils/clear-error.md +1 -1
  117. package/4.api/3.utils/create-error.md +7 -7
  118. package/4.api/3.utils/define-lazy-hydration-component.md +5 -5
  119. package/4.api/3.utils/define-nuxt-component.md +1 -1
  120. package/4.api/3.utils/define-nuxt-plugin.md +12 -12
  121. package/4.api/3.utils/define-nuxt-route-middleware.md +2 -2
  122. package/4.api/3.utils/define-page-meta.md +18 -11
  123. package/4.api/3.utils/define-route-rules.md +2 -2
  124. package/4.api/3.utils/navigate-to.md +14 -14
  125. package/4.api/3.utils/on-before-route-leave.md +1 -1
  126. package/4.api/3.utils/on-before-route-update.md +1 -1
  127. package/4.api/3.utils/preload-route-components.md +2 -2
  128. package/4.api/3.utils/refresh-cookie.md +0 -2
  129. package/4.api/3.utils/refresh-nuxt-data.md +1 -1
  130. package/4.api/3.utils/reload-nuxt-app.md +1 -1
  131. package/4.api/3.utils/set-page-layout.md +36 -0
  132. package/4.api/3.utils/set-response-status.md +3 -3
  133. package/4.api/3.utils/show-error.md +4 -4
  134. package/4.api/3.utils/update-app-config.md +1 -1
  135. package/4.api/4.commands/add.md +12 -12
  136. package/4.api/4.commands/analyze.md +11 -11
  137. package/4.api/4.commands/build-module.md +11 -11
  138. package/4.api/4.commands/build.md +12 -12
  139. package/4.api/4.commands/cleanup.md +6 -6
  140. package/4.api/4.commands/dev.md +23 -23
  141. package/4.api/4.commands/devtools.md +7 -7
  142. package/4.api/4.commands/generate.md +12 -12
  143. package/4.api/4.commands/info.md +6 -6
  144. package/4.api/4.commands/init.md +18 -18
  145. package/4.api/4.commands/module.md +18 -18
  146. package/4.api/4.commands/prepare.md +10 -10
  147. package/4.api/4.commands/preview.md +11 -11
  148. package/4.api/4.commands/test.md +9 -9
  149. package/4.api/4.commands/typecheck.md +10 -10
  150. package/4.api/4.commands/upgrade.md +10 -10
  151. package/4.api/5.kit/1.modules.md +31 -18
  152. package/4.api/5.kit/10.templates.md +23 -23
  153. package/4.api/5.kit/11.nitro.md +40 -36
  154. package/4.api/5.kit/12.resolving.md +2 -2
  155. package/4.api/5.kit/14.builder.md +35 -23
  156. package/4.api/5.kit/16.layers.md +16 -16
  157. package/4.api/5.kit/2.programmatic.md +2 -2
  158. package/4.api/5.kit/3.compatibility.md +2 -2
  159. package/4.api/5.kit/4.autoimports.md +23 -19
  160. package/4.api/5.kit/5.components.md +35 -35
  161. package/4.api/5.kit/6.context.md +1 -1
  162. package/4.api/5.kit/8.layout.md +1 -1
  163. package/4.api/6.advanced/1.hooks.md +85 -85
  164. package/4.api/index.md +7 -7
  165. package/5.community/4.contribution.md +10 -10
  166. package/5.community/5.framework-contribution.md +9 -9
  167. package/5.community/6.roadmap.md +26 -26
  168. package/5.community/7.changelog.md +10 -0
  169. package/6.bridge/1.overview.md +8 -0
  170. package/6.bridge/3.bridge-composition-api.md +2 -2
  171. package/6.bridge/4.plugins-and-middleware.md +2 -2
  172. package/6.bridge/5.nuxt3-compatible-api.md +1 -1
  173. package/6.bridge/8.nitro.md +4 -0
  174. package/7.migration/10.bundling.md +1 -1
  175. package/7.migration/11.server.md +3 -3
  176. package/7.migration/2.configuration.md +5 -5
  177. package/7.migration/20.module-authors.md +3 -3
  178. package/7.migration/4.meta.md +1 -1
  179. package/7.migration/5.plugins-and-middleware.md +3 -3
  180. package/7.migration/6.pages-and-layouts.md +5 -5
  181. package/7.migration/7.component-options.md +6 -6
  182. package/7.migration/8.runtime-config.md +1 -1
  183. package/package.json +1 -1
  184. package/3.guide/4.going-further/1.features.md +0 -103
  185. package/3.guide/4.going-further/3.modules.md +0 -901
  186. /package/3.guide/{3.recipes → 5.recipes}/.navigation.yml +0 -0
  187. /package/3.guide/{4.going-further → 6.going-further}/.navigation.yml +0 -0
  188. /package/3.guide/{4.going-further → 6.going-further}/index.md +0 -0
@@ -44,7 +44,7 @@ Overall, server-side rendering can provide a faster and more efficient user expe
44
44
  As Nuxt is a versatile framework, it gives you the possibility to statically render your whole application to a static hosting with `nuxt generate`,
45
45
  disable SSR globally with the `ssr: false` option or leverage hybrid rendering by setting up the `routeRules` option.
46
46
 
47
- :read-more{title="Nuxt rendering modes" to="/docs/guide/concepts/rendering"}
47
+ :read-more{title="Nuxt rendering modes" to="/docs/3.x/guide/concepts/rendering"}
48
48
 
49
49
  ### Server engine
50
50
 
@@ -54,19 +54,19 @@ In development, it uses Rollup and Node.js workers for your server code and cont
54
54
 
55
55
  In production, Nitro builds your app and server into one universal `.output` directory. This output is light: minified and removed from any Node.js modules (except polyfills). You can deploy this output on any system supporting JavaScript, from Node.js, Serverless, Workers, Edge-side rendering or purely static.
56
56
 
57
- :read-more{title="Nuxt server engine" to="/docs/guide/concepts/server-engine"}
57
+ :read-more{title="Nuxt server engine" to="/docs/3.x/guide/concepts/server-engine"}
58
58
 
59
59
  ### Production-ready
60
60
 
61
61
  A Nuxt application can be deployed on a Node or Deno server, pre-rendered to be hosted in static environments, or deployed to serverless and edge providers.
62
62
 
63
- :read-more{title="Deployment section" to="/docs/getting-started/deployment"}
63
+ :read-more{title="Deployment section" to="/docs/3.x/getting-started/deployment"}
64
64
 
65
65
  ### Modular
66
66
 
67
67
  A module system allows you to extend Nuxt with custom features and integrations with third-party services.
68
68
 
69
- :read-more{title="Nuxt Modules Concept" to="/docs/guide/concepts/modules"}
69
+ :read-more{title="Nuxt Modules Concept" to="/docs/3.x/guide/concepts/modules"}
70
70
 
71
71
  ### Architecture
72
72
 
@@ -17,9 +17,7 @@ Or follow the steps below to set up a new Nuxt project on your computer.
17
17
 
18
18
  ## New Project
19
19
 
20
- <!-- TODO: need to fix upstream in nuxt/nuxt.com -->
21
- <!-- markdownlint-disable-next-line MD001 -->
22
- #### Prerequisites
20
+ ### Prerequisites
23
21
 
24
22
  - **Node.js** - [`20.x`](https://nodejs.org/en) or newer (but we recommend the [active LTS release](https://github.com/nodejs/release#release-schedule))
25
23
  - **Text editor** - There is no IDE requirement, but we recommend [Visual Studio Code](https://code.visualstudio.com/) with the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously known as Volar) or [WebStorm](https://www.jetbrains.com/webstorm/), which, along with [other JetBrains IDEs](https://www.jetbrains.com/ides/), offers great Nuxt support right out-of-the-box.
@@ -29,13 +27,12 @@ Or follow the steps below to set up a new Nuxt project on your computer.
29
27
  ::details
30
28
  :summary[Additional notes for an optimal setup:]
31
29
  - **Node.js**: Make sure to use an even numbered version (20, 22, etc.)
32
- - **Nuxtr**: Install the community-developed [Nuxtr extension](https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode)
33
30
  - **WSL**: If you are using Windows and experience slow HMR, you may want to try using [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install) which may solve some performance issues.
34
31
  - **Windows slow DNS resolution**: Instead of using `localhost:3000` for local dev server on Windows, use `127.0.0.1` for much faster loading experience on browsers.
35
32
  ::
36
33
  ::
37
34
 
38
- Open a terminal (if you're using [Visual Studio Code](https://code.visualstudio.com), you can open an [integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal)) and use the following command to create a new starter project:
35
+ Open a terminal (if you're using [Visual Studio Code](https://code.visualstudio.com), you can open an [integrated terminal](https://code.visualstudio.com/docs/terminal/basics)) and use the following command to create a new starter project:
39
36
 
40
37
  ::code-group{sync="pm"}
41
38
 
@@ -44,7 +41,7 @@ npm create nuxt@latest <project-name> -- -t v3
44
41
  ```
45
42
 
46
43
  ```bash [yarn]
47
- yarn create nuxt@latest <project-name> -t v3
44
+ yarn create nuxt <project-name> -t v3
48
45
  ```
49
46
 
50
47
  ```bash [pnpm]
@@ -115,4 +112,4 @@ Well done! A browser window should automatically open for <http://localhost:3000
115
112
 
116
113
  Now that you've created your Nuxt project, you are ready to start building your application.
117
114
 
118
- :read-more{title="Nuxt Concepts" to="/docs/guide/concepts"}
115
+ :read-more{title="Nuxt Concepts" to="/docs/3.x/guide/concepts"}
@@ -20,7 +20,7 @@ export default defineNuxtConfig({
20
20
 
21
21
  This file will often be mentioned in the documentation, for example to add custom scripts, register modules or change rendering modes.
22
22
 
23
- ::read-more{to="/docs/api/configuration/nuxt-config"}
23
+ ::read-more{to="/docs/3.x/api/configuration/nuxt-config"}
24
24
  Every option is described in the **Configuration Reference**.
25
25
  ::
26
26
 
@@ -96,7 +96,7 @@ const runtimeConfig = useRuntimeConfig()
96
96
  </script>
97
97
  ```
98
98
 
99
- :read-more{to="/docs/guide/going-further/runtime-config"}
99
+ :read-more{to="/docs/3.x/guide/going-further/runtime-config"}
100
100
 
101
101
  ## App Configuration
102
102
 
@@ -124,7 +124,7 @@ const appConfig = useAppConfig()
124
124
  </script>
125
125
  ```
126
126
 
127
- :read-more{to="/docs/guide/directory-structure/app-config"}
127
+ :read-more{to="/docs/3.x/directory-structure/app-config"}
128
128
 
129
129
  ## `runtimeConfig` vs. `app.config`
130
130
 
@@ -133,37 +133,37 @@ As stated above, `runtimeConfig` and `app.config` are both used to expose variab
133
133
  - `runtimeConfig`: Private or public tokens that need to be specified after build using environment variables.
134
134
  - `app.config`: Public tokens that are determined at build time, website configuration such as theme variant, title and any project config that are not sensitive.
135
135
 
136
- Feature | `runtimeConfig` | `app.config`
137
- -------------------------------|------------------|-------------------
138
- Client Side | Hydrated | Bundled
139
- Environment Variables | ✅ Yes | ❌ No
140
- Reactive | ✅ Yes | ✅ Yes
141
- Types support | ✅ Partial | ✅ Yes
142
- Configuration per Request | ❌ No | ✅ Yes
143
- Hot Module Replacement | ❌ No | ✅ Yes
144
- Non primitive JS types | ❌ No | ✅ Yes
136
+ | Feature | `runtimeConfig` | `app.config` |
137
+ |---------------------------|-----------------|--------------|
138
+ | Client-side | Hydrated | Bundled |
139
+ | Environment variables | ✅ Yes | ❌ No |
140
+ | Reactive | ✅ Yes | ✅ Yes |
141
+ | Types support | ✅ Partial | ✅ Yes |
142
+ | Configuration per request | ❌ No | ✅ Yes |
143
+ | Hot module replacement | ❌ No | ✅ Yes |
144
+ | Non-primitive JS types | ❌ No | ✅ Yes |
145
145
 
146
146
  ## External Configuration Files
147
147
 
148
148
  Nuxt uses [`nuxt.config.ts`](/docs/3.x/directory-structure/nuxt-config) file as the single source of truth for configurations and skips reading external configuration files. During the course of building your project, you may have a need to configure those. The following table highlights common configurations and, where applicable, how they can be configured with Nuxt.
149
149
 
150
- Name | Config File | How To Configure
151
- ---------------------------------------------|---------------------------|-------------------------
152
- [Nitro](https://nitro.build) | ~~`nitro.config.ts`~~ | Use [`nitro`](/docs/3.x/api/nuxt-config#nitro) key in `nuxt.config`
153
- [PostCSS](https://postcss.org) | ~~`postcss.config.js`~~ | Use [`postcss`](/docs/3.x/api/nuxt-config#postcss) key in `nuxt.config`
154
- [Vite](https://vite.dev) | ~~`vite.config.ts`~~ | Use [`vite`](/docs/3.x/api/nuxt-config#vite) key in `nuxt.config`
155
- [webpack](https://webpack.js.org) | ~~`webpack.config.ts`~~ | Use [`webpack`](/docs/3.x/api/nuxt-config#webpack-1) key in `nuxt.config`
150
+ | Name | Config File | How To Configure |
151
+ |-----------------------------------|-------------------------|---------------------------------------------------------------------------|
152
+ | [Nitro](https://nitro.build) | ~~`nitro.config.ts`~~ | Use [`nitro`](/docs/3.x/api/nuxt-config#nitro) key in `nuxt.config` |
153
+ | [PostCSS](https://postcss.org) | ~~`postcss.config.js`~~ | Use [`postcss`](/docs/3.x/api/nuxt-config#postcss) key in `nuxt.config` |
154
+ | [Vite](https://vite.dev) | ~~`vite.config.ts`~~ | Use [`vite`](/docs/3.x/api/nuxt-config#vite) key in `nuxt.config` |
155
+ | [webpack](https://webpack.js.org) | ~~`webpack.config.ts`~~ | Use [`webpack`](/docs/3.x/api/nuxt-config#webpack-1) key in `nuxt.config` |
156
156
 
157
157
  Here is a list of other common config files:
158
158
 
159
- Name | Config File | How To Configure
160
- ---------------------------------------------|-------------------------|--------------------------
161
- [TypeScript](https://www.typescriptlang.org) | `tsconfig.json` | [More Info](/docs/3.x/guide/concepts/typescript#nuxttsconfigjson)
162
- [ESLint](https://eslint.org) | `eslint.config.js` | [More Info](https://eslint.org/docs/latest/use/configure/configuration-files)
163
- [Prettier](https://prettier.io) | `prettier.config.js` | [More Info](https://prettier.io/docs/en/configuration.html)
164
- [Stylelint](https://stylelint.io) | `stylelint.config.js` | [More Info](https://stylelint.io/user-guide/configure)
165
- [TailwindCSS](https://tailwindcss.com) | `tailwind.config.js` | [More Info](https://tailwindcss.nuxtjs.org/tailwindcss/configuration)
166
- [Vitest](https://vitest.dev) | `vitest.config.ts` | [More Info](https://vitest.dev/config/)
159
+ | Name | Config File | How To Configure |
160
+ |----------------------------------------------|-----------------------|-------------------------------------------------------------------------------|
161
+ | [TypeScript](https://www.typescriptlang.org) | `tsconfig.json` | [More Info](/docs/3.x/directory-structure/tsconfig) |
162
+ | [ESLint](https://eslint.org) | `eslint.config.js` | [More Info](https://eslint.org/docs/latest/use/configure/configuration-files) |
163
+ | [Prettier](https://prettier.io) | `prettier.config.js` | [More Info](https://prettier.io/docs/configuration.html) |
164
+ | [Stylelint](https://stylelint.io) | `stylelint.config.js` | [More Info](https://stylelint.io/user-guide/configure/) |
165
+ | [TailwindCSS](https://tailwindcss.com) | `tailwind.config.js` | [More Info](https://tailwindcss.nuxtjs.org/tailwindcss/configuration/) |
166
+ | [Vitest](https://vitest.dev) | `vitest.config.ts` | [More Info](https://vitest.dev/config/) |
167
167
 
168
168
  ## Vue Configuration
169
169
 
@@ -187,7 +187,7 @@ export default defineNuxtConfig({
187
187
  })
188
188
  ```
189
189
 
190
- :read-more{to="/docs/api/configuration/nuxt-config#vue"}
190
+ :read-more{to="/docs/3.x/api/configuration/nuxt-config#vue"}
191
191
 
192
192
  ### With webpack
193
193
 
@@ -205,7 +205,7 @@ export default defineNuxtConfig({
205
205
  })
206
206
  ```
207
207
 
208
- :read-more{to="/docs/api/configuration/nuxt-config#loaders"}
208
+ :read-more{to="/docs/3.x/api/configuration/nuxt-config#loaders"}
209
209
 
210
210
  ### Enabling Experimental Vue Features
211
211
 
@@ -223,4 +223,4 @@ export default defineNuxtConfig({
223
223
 
224
224
  Since Nuxt 3.9 and Vue 3.4, `reactivityTransform` has been moved from Vue to Vue Macros which has a [Nuxt integration](https://vue-macros.dev/guide/nuxt-integration.html).
225
225
 
226
- :read-more{to="/docs/api/configuration/nuxt-config#vue-1"}
226
+ :read-more{to="/docs/3.x/api/configuration/nuxt-config#vue-1"}
@@ -57,7 +57,7 @@ Most components are reusable pieces of the user interface, like buttons and menu
57
57
 
58
58
  Pages represent views for each specific route pattern. Every file in the [`pages/`](/docs/3.x/directory-structure/pages) directory represents a different route displaying its content.
59
59
 
60
- To use pages, create `pages/index.vue` file and add `<NuxtPage />` component to the [`app.vue`](/docs/3.x/directory-structure/app) (or remove `app.vue` for default entry). You can now create more pages and their corresponding routes by adding new files in the [`pages/`](/docs/3.x/directory-structure/pages) directory.
60
+ To use pages, create an `pages/index.vue` file and add `<NuxtPage />` component to the [`app.vue`](/docs/3.x/directory-structure/app) (or remove `app.vue` for default entry). You can now create more pages and their corresponding routes by adding new files in the [`pages/`](/docs/3.x/directory-structure/pages) directory.
61
61
 
62
62
  ::code-group
63
63
 
@@ -82,7 +82,7 @@ To use pages, create `pages/index.vue` file and add `<NuxtPage />` component to
82
82
 
83
83
  ::
84
84
 
85
- :read-more{title="Routing Section" to="/docs/getting-started/routing"}
85
+ :read-more{title="Routing Section" to="/docs/3.x/getting-started/routing"}
86
86
 
87
87
  ## Layouts
88
88
 
@@ -148,7 +148,9 @@ If you only need to modify the `<head>`, you can refer to the [SEO and meta sect
148
148
  You can have full control over the HTML template by adding a Nitro plugin that registers a hook.
149
149
  The callback function of the `render:html` hook allows you to mutate the HTML before it is sent to the client.
150
150
 
151
- ```ts twoslash [server/plugins/extend-html.ts]
151
+ <!-- TODO: figure out how to use twoslash to inject types for a different context -->
152
+
153
+ ```ts [server/plugins/extend-html.ts]
152
154
  export default defineNitroPlugin((nitroApp) => {
153
155
  nitroApp.hooks.hook('render:html', (html, { event }) => {
154
156
  // This will be an object representation of the html template.
@@ -160,4 +162,4 @@ export default defineNitroPlugin((nitroApp) => {
160
162
  })
161
163
  ```
162
164
 
163
- :read-more{to="/docs/guide/going-further/hooks"}
165
+ :read-more{to="/docs/3.x/guide/going-further/hooks"}
@@ -30,7 +30,7 @@ For example, referencing an image file in the `public/img/` directory, available
30
30
 
31
31
  ## Assets Directory
32
32
 
33
- Nuxt uses [Vite](https://vite.dev/guide/assets.html) (default) or [webpack](https://webpack.js.org/guides/asset-management) to build and bundle your application. The main function of these build tools is to process JavaScript files, but they can be extended through [plugins](https://vite.dev/plugins) (for Vite) or [loaders](https://webpack.js.org/loaders) (for webpack) to process other kinds of assets, like stylesheets, fonts or SVGs. This step transforms the original file, mainly for performance or caching purposes (such as stylesheet minification or browser cache invalidation).
33
+ Nuxt uses [Vite](https://vite.dev/guide/assets) (default) or [webpack](https://webpack.js.org/guides/asset-management/) to build and bundle your application. The main function of these build tools is to process JavaScript files, but they can be extended through [plugins](https://vite.dev/plugins/) (for Vite) or [loaders](https://webpack.js.org/loaders/) (for webpack) to process other kinds of assets, like stylesheets, fonts or SVGs. This step transforms the original file, mainly for performance or caching purposes (such as stylesheet minification or browser cache invalidation).
34
34
 
35
35
  By convention, Nuxt uses the [`assets/`](/docs/3.x/directory-structure/assets) directory to store these files but there is no auto-scan functionality for this directory, and you can use any other name for it.
36
36
 
@@ -50,5 +50,5 @@ For example, referencing an image file that will be processed if a build tool is
50
50
  ```
51
51
 
52
52
  ::note
53
- Nuxt won't serve files in the [`assets/`](/docs/3.x/directory-structure/assets) directory at a static URL like `/assets/my-file.png`. If you need a static URL, use the [`public/`](#public-directory) directory.
53
+ Nuxt won't serve files in the [`assets/`](/docs/3.x/directory-structure/assets) directory at a static URL like `/assets/my-file.png`. If you need a static URL, use the [`public/`](/docs/3.x/getting-started/assets#public-directory) directory.
54
54
  ::
@@ -14,7 +14,7 @@ If you're writing local stylesheets, the natural place to put them is the [`asse
14
14
  ### Importing Within Components
15
15
 
16
16
  You can import stylesheets in your pages, layouts and components directly.
17
- You can use a JavaScript import, or a CSS [`@import` statement](https://developer.mozilla.org/en-US/docs/Web/CSS/@import).
17
+ You can use a JavaScript import, or a CSS [`@import` statement](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@import).
18
18
 
19
19
  ```vue [pages/index.vue]
20
20
  <script>
@@ -95,6 +95,10 @@ pnpm install animate.css
95
95
  bun install animate.css
96
96
  ```
97
97
 
98
+ ```bash [deno]
99
+ deno install npm:animate.css
100
+ ```
101
+
98
102
  ::
99
103
 
100
104
  Then you can reference it directly in your pages, layouts and components:
@@ -137,7 +141,7 @@ export default defineNuxtConfig({
137
141
 
138
142
  You can use the useHead composable to dynamically set a value in your head in your code.
139
143
 
140
- :read-more{to="/docs/api/composables/use-head"}
144
+ :read-more{to="/docs/3.x/api/composables/use-head"}
141
145
 
142
146
  ```ts twoslash
143
147
  useHead({
@@ -153,7 +157,9 @@ If you need more advanced control, you can intercept the rendered html with a ho
153
157
 
154
158
  Create a plugin in `~/server/plugins/my-plugin.ts` like this:
155
159
 
156
- ```ts twoslash [server/plugins/my-plugin.ts]
160
+ <!-- TODO: figure out how to use twoslash to inject types for a different context -->
161
+
162
+ ```ts [server/plugins/my-plugin.ts]
157
163
  export default defineNitroPlugin((nitro) => {
158
164
  nitro.hooks.hook('render:html', (html) => {
159
165
  html.head.push('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">')
@@ -161,7 +167,7 @@ export default defineNitroPlugin((nitro) => {
161
167
  })
162
168
  ```
163
169
 
164
- External stylesheets are render-blocking resources: they must be loaded and processed before the browser renders the page. Web pages that contain unnecessarily large styles take longer to render. You can read more about it on [web.dev](https://web.dev/defer-non-critical-css).
170
+ External stylesheets are render-blocking resources: they must be loaded and processed before the browser renders the page. Web pages that contain unnecessarily large styles take longer to render. You can read more about it on [web.dev](https://web.dev/articles/defer-non-critical-css).
165
171
 
166
172
  ## Using Preprocessors
167
173
 
@@ -204,7 +210,7 @@ export default defineNuxtConfig({
204
210
  In both cases, the compiled stylesheets will be inlined in the HTML rendered by Nuxt.
205
211
  ::
206
212
 
207
- If you need to inject code in pre-processed files, like a [Sass partial](https://sass-lang.com/documentation/at-rules/use#partials) with color variables, you can do so with the Vite [preprocessors options](https://vite.dev/config/shared-options.html#css-preprocessoroptions).
213
+ If you need to inject code in pre-processed files, like a [Sass partial](https://sass-lang.com/documentation/at-rules/use/#partials) with color variables, you can do so with the Vite [preprocessors options](https://vite.dev/config/shared-options#css-preprocessoroptions).
208
214
 
209
215
  Create some partials in your `assets` directory:
210
216
 
@@ -256,11 +262,11 @@ export default defineNuxtConfig({
256
262
 
257
263
  ::
258
264
 
259
- Nuxt uses Vite by default. If you wish to use webpack instead, refer to each preprocessor loader [documentation](https://webpack.js.org/loaders/sass-loader).
265
+ Nuxt uses Vite by default. If you wish to use webpack instead, refer to each preprocessor loader [documentation](https://webpack.js.org/loaders/sass-loader/).
260
266
 
261
267
  ### Preprocessor Workers (Experimental)
262
268
 
263
- Vite has made available an [experimental option](https://vite.dev/config/shared-options.html#css-preprocessormaxworkers) which can speed up using preprocessors.
269
+ Vite has made available an [experimental option](https://vite.dev/config/shared-options#css-preprocessormaxworkers) which can speed up using preprocessors.
264
270
 
265
271
  You can enable this in your `nuxt.config`:
266
272
 
@@ -282,7 +288,7 @@ This is an experimental option and you should refer to the Vite documentation an
282
288
 
283
289
  One of the best things about Vue and SFC is how great it is at naturally dealing with styling. You can directly write CSS or preprocessor code in the style block of your components file, therefore you will have fantastic developer experience without having to use something like CSS-in-JS. However if you wish to use CSS-in-JS, you can find 3rd party libraries and modules that support it, such as [pinceau](https://github.com/Tahul/pinceau).
284
290
 
285
- You can refer to the [Vue docs](https://vuejs.org/api/sfc-css-features.html) for a comprehensive reference about styling components in SFC.
291
+ You can refer to the [Vue docs](https://vuejs.org/api/sfc-css-features) for a comprehensive reference about styling components in SFC.
286
292
 
287
293
  ### Class And Style Bindings
288
294
 
@@ -352,7 +358,7 @@ const styleObject = reactive({ color: 'red', fontSize: '13px' })
352
358
 
353
359
  ::
354
360
 
355
- Refer to the [Vue docs](https://vuejs.org/guide/essentials/class-and-style.html) for more information.
361
+ Refer to the [Vue docs](https://vuejs.org/guide/essentials/class-and-style) for more information.
356
362
 
357
363
  ### Dynamic Styles With `v-bind`
358
364
 
@@ -445,7 +451,7 @@ SFC style blocks support preprocessor syntax. Vite comes with built-in support f
445
451
 
446
452
  ::
447
453
 
448
- You can refer to the [Vite CSS docs](https://vite.dev/guide/features.html#css) and the [@vitejs/plugin-vue docs](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue).
454
+ You can refer to the [Vite CSS docs](https://vite.dev/guide/features#css) and the [@vitejs/plugin-vue docs](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue).
449
455
  For webpack users, refer to the [vue loader docs](https://vue-loader.vuejs.org).
450
456
 
451
457
  ## Using PostCSS
@@ -476,7 +482,7 @@ By default, Nuxt comes with the following plugins already pre-configured:
476
482
  - [postcss-import](https://github.com/postcss/postcss-import): Improves the `@import` rule
477
483
  - [postcss-url](https://github.com/postcss/postcss-url): Transforms `url()` statements
478
484
  - [autoprefixer](https://github.com/postcss/autoprefixer): Automatically adds vendor prefixes
479
- - [cssnano](https://cssnano.github.io/cssnano): Minification and purge
485
+ - [cssnano](https://cssnano.github.io/cssnano/): Minification and purge
480
486
 
481
487
  ## Leveraging Layouts For Multiple Styles
482
488
 
@@ -498,7 +504,7 @@ Use different styles for different layouts.
498
504
  </style>
499
505
  ```
500
506
 
501
- :read-more{to="/docs/guide/directory-structure/layouts"}
507
+ :read-more{to="/docs/3.x/directory-structure/layouts"}
502
508
 
503
509
  ## Third Party Libraries And Modules
504
510
 
@@ -515,7 +521,7 @@ Here are a few modules to help you get started:
515
521
  - [Nuxt UI](https://ui.nuxt.com): A UI Library for Modern Web Apps
516
522
  - [Panda CSS](https://panda-css.com/docs/installation/nuxt): CSS-in-JS engine that generates atomic CSS at build time
517
523
 
518
- Nuxt modules provide you with a good developer experience out of the box, but remember that if your favorite tool doesn't have a module, it doesn't mean that you can't use it with Nuxt! You can configure it yourself for your own project. Depending on the tool, you might need to use a [Nuxt plugin](/docs/3.x/directory-structure/plugins) and/or [make your own module](/docs/3.x/guide/going-further/modules). Share them with the [community](/modules) if you do!
524
+ Nuxt modules provide you with a good developer experience out of the box, but remember that if your favorite tool doesn't have a module, it doesn't mean that you can't use it with Nuxt! You can configure it yourself for your own project. Depending on the tool, you might need to use a [Nuxt plugin](/docs/3.x/directory-structure/plugins) and/or [make your own module](/docs/3.x/guide/modules). Share them with the [community](/modules) if you do!
519
525
 
520
526
  ### Easily Load Webfonts
521
527
 
@@ -529,11 +535,11 @@ If you are using [UnoCSS](https://unocss.dev/integrations/nuxt), note that it co
529
535
 
530
536
  Nuxt comes with the same `<Transition>` element that Vue has, and also has support for the experimental [View Transitions API](/docs/3.x/getting-started/transitions#view-transitions-api-experimental).
531
537
 
532
- :read-more{to="/docs/getting-started/transitions"}
538
+ :read-more{to="/docs/3.x/getting-started/transitions"}
533
539
 
534
540
  ### Font Advanced Optimization
535
541
 
536
- We would recommend using [Fontaine](https://github.com/nuxt-modules/fontaine) to reduce your [CLS](https://web.dev/cls). If you need something more advanced, consider creating a Nuxt module to extend the build process or the Nuxt runtime.
542
+ We would recommend using [Fontaine](https://github.com/nuxt-modules/fontaine) to reduce your [CLS](https://web.dev/articles/cls). If you need something more advanced, consider creating a Nuxt module to extend the build process or the Nuxt runtime.
537
543
 
538
544
  ::tip
539
545
  Always remember to take advantage of the various tools and techniques available in the Web ecosystem at large to make styling your application easier and more efficient. Whether you're using native CSS, a preprocessor, postcss, a UI library or a module, Nuxt has got you covered. Happy styling!
@@ -549,7 +555,7 @@ You can do the following to speed-up the download of your global CSS files:
549
555
  - Host your assets on the same domain (do not use a different subdomain)
550
556
 
551
557
  Most of these things should be done for you automatically if you're using modern platforms like Cloudflare, Netlify or Vercel.
552
- You can find an LCP optimization guide on [web.dev](https://web.dev/optimize-lcp).
558
+ You can find an LCP optimization guide on [web.dev](https://web.dev/articles/optimize-lcp).
553
559
 
554
560
  If all of your CSS is inlined by Nuxt, you can (experimentally) completely stop external CSS files from being referenced in your rendered HTML.
555
561
  You can achieve that with a hook, that you can place in a module, or in your Nuxt configuration file.
@@ -43,7 +43,7 @@ This file system routing uses naming conventions to create dynamic and nested ro
43
43
 
44
44
  ::
45
45
 
46
- :read-more{to="/docs/guide/directory-structure/pages"}
46
+ :read-more{to="/docs/3.x/directory-structure/pages"}
47
47
 
48
48
  ## Navigation
49
49
 
@@ -65,7 +65,7 @@ When a [`<NuxtLink>`](/docs/3.x/api/components/nuxt-link) enters the viewport on
65
65
  </template>
66
66
  ```
67
67
 
68
- :read-more{to="/docs/api/components/nuxt-link"}
68
+ :read-more{to="/docs/3.x/api/components/nuxt-link"}
69
69
 
70
70
  ## Route Parameters
71
71
 
@@ -80,7 +80,7 @@ console.log(route.params.id)
80
80
  </script>
81
81
  ```
82
82
 
83
- :read-more{to="/docs/api/composables/use-route"}
83
+ :read-more{to="/docs/3.x/api/composables/use-route"}
84
84
 
85
85
  ## Route Middleware
86
86
 
@@ -129,13 +129,13 @@ definePageMeta({
129
129
 
130
130
  ::
131
131
 
132
- :read-more{to="/docs/guide/directory-structure/middleware"}
132
+ :read-more{to="/docs/3.x/directory-structure/middleware"}
133
133
 
134
134
  ## Route Validation
135
135
 
136
136
  Nuxt offers route validation via the `validate` property in [`definePageMeta()`](/docs/3.x/api/utils/define-page-meta) in each page you wish to validate.
137
137
 
138
- The `validate` property accepts the `route` as an argument. You can return a boolean value to determine whether or not this is a valid route to be rendered with this page. If you return `false`, this will cause a 404 error. You can also directly return an object with `statusCode`/`statusMessage` to customize the error returned.
138
+ The `validate` property accepts the `route` as an argument. You can return a boolean value to determine whether or not this is a valid route to be rendered with this page. If you return `false`, this will cause a 404 error. You can also directly return an object with `status`/`statusText` to customize the error returned.
139
139
 
140
140
  If you have a more complex use case, then you can use anonymous route middleware instead.
141
141
 
@@ -150,4 +150,4 @@ definePageMeta({
150
150
  </script>
151
151
  ```
152
152
 
153
- :read-more{to="/docs/api/utils/define-page-meta"}
153
+ :read-more{to="/docs/3.x/api/utils/define-page-meta"}
@@ -33,7 +33,7 @@ export default defineNuxtConfig({
33
33
  })
34
34
  ```
35
35
 
36
- You can also provide any of the keys listed below in [Types](#types).
36
+ You can also provide any of the keys listed below in [Types](/docs/3.x/getting-started/seo-meta#types).
37
37
 
38
38
  ### Defaults Tags
39
39
 
@@ -96,7 +96,7 @@ useSeoMeta({
96
96
  </script>
97
97
  ```
98
98
 
99
- :read-more{to="/docs/api/composables/use-seo-meta"}
99
+ :read-more{to="/docs/3.x/api/composables/use-seo-meta"}
100
100
 
101
101
  ## Components
102
102
 
@@ -134,6 +134,10 @@ const title = ref('Hello World')
134
134
 
135
135
  It's suggested to wrap your components in either a `<Head>` or `<Html>` components as tags will be deduped more intuitively.
136
136
 
137
+ ::warning
138
+ If you need to duplicate tags across client-server boundaries, apply a `key` attribute on the `<Head>` component.
139
+ ::
140
+
137
141
  ## Types
138
142
 
139
143
  Below are the non-reactive types used for [`useHead`](/docs/3.x/api/composables/use-head), [`app.head`](/docs/3.x/api/nuxt-config#head) and components.
@@ -297,9 +301,9 @@ useHead({
297
301
  </script>
298
302
  ```
299
303
 
300
- :link-example{to="/docs/examples/features/meta-tags"}
304
+ :link-example{to="/docs/3.x/examples/features/meta-tags"}
301
305
 
302
- :read-more{to="/docs/guide/directory-structure/pages/#page-metadata"}
306
+ :read-more{to="/docs/3.x/directory-structure/pages/#page-metadata"}
303
307
 
304
308
  ### Dynamic Title
305
309
 
@@ -5,7 +5,7 @@ navigation.icon: i-lucide-toggle-right
5
5
  ---
6
6
 
7
7
  ::note
8
- Nuxt leverages Vue's [`<Transition>`](https://vuejs.org/guide/built-ins/transition.html#the-transition-component) component to apply transitions between pages and layouts.
8
+ Nuxt leverages Vue's [`<Transition>`](https://vuejs.org/guide/built-ins/transition#the-transition-component) component to apply transitions between pages and layouts.
9
9
  ::
10
10
 
11
11
  ## Page Transitions
@@ -229,7 +229,7 @@ definePageMeta({
229
229
 
230
230
  You can customize these default transition names globally using `nuxt.config`.
231
231
 
232
- Both `pageTransition` and `layoutTransition` keys accept [`TransitionProps`](https://vuejs.org/api/built-in-components.html#transition) as JSON serializable values where you can pass the `name`, `mode` and other valid transition-props of the custom CSS transition.
232
+ Both `pageTransition` and `layoutTransition` keys accept [`TransitionProps`](https://vuejs.org/api/built-in-components#transition) as JSON serializable values where you can pass the `name`, `mode` and other valid transition-props of the custom CSS transition.
233
233
 
234
234
  ```ts twoslash [nuxt.config.ts]
235
235
  export default defineNuxtConfig({
@@ -310,7 +310,7 @@ definePageMeta({
310
310
  ```
311
311
 
312
312
  ::tip
313
- Learn more about additional [JavaScript hooks](https://vuejs.org/guide/built-ins/transition.html#javascript-hooks) available in the `Transition` component.
313
+ Learn more about additional [JavaScript hooks](https://vuejs.org/guide/built-ins/transition#javascript-hooks) available in the `Transition` component.
314
314
  ::
315
315
 
316
316
  ## Dynamic Transitions
@@ -416,11 +416,11 @@ Remember, this page transition cannot be overridden with `definePageMeta` on ind
416
416
 
417
417
  ## View Transitions API (experimental)
418
418
 
419
- Nuxt ships with an experimental implementation of the [**View Transitions API**](https://developer.chrome.com/docs/web-platform/view-transitions) (see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API)). This is an exciting new way to implement native browser transitions which (among other things) have the ability to transition between unrelated elements on different pages.
419
+ Nuxt ships with an experimental implementation of the [**View Transitions API**](https://developer.chrome.com/docs/web-platform/view-transitions) (see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API)). This is an exciting new way to implement native browser transitions which (among other things) have the ability to transition between unrelated elements on different pages.
420
420
 
421
- You can check a demo on https://nuxt-view-transitions.surge.sh and the [source on StackBlitz](https://stackblitz.com/edit/nuxt-view-transitions).
421
+ You can check a demo [on StackBlitz](https://stackblitz.com/edit/nuxt-view-transitions).
422
422
 
423
- The Nuxt integration is under active development, but can be enabled with the `experimental.viewTransition` option in your configuration file:
423
+ The Nuxt integration can be enabled with the `experimental.viewTransition` option in your configuration file:
424
424
 
425
425
  ```ts twoslash [nuxt.config.ts]
426
426
  export default defineNuxtConfig({