@nuxt/docs 4.1.2 → 4.2.0

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 (201) hide show
  1. package/1.getting-started/01.introduction.md +6 -6
  2. package/1.getting-started/02.installation.md +3 -2
  3. package/1.getting-started/03.configuration.md +36 -36
  4. package/1.getting-started/04.views.md +9 -9
  5. package/1.getting-started/05.assets.md +15 -9
  6. package/1.getting-started/06.styling.md +58 -48
  7. package/1.getting-started/07.routing.md +17 -17
  8. package/1.getting-started/08.seo-meta.md +59 -46
  9. package/1.getting-started/09.transitions.md +49 -44
  10. package/1.getting-started/10.data-fetching.md +104 -81
  11. package/1.getting-started/11.state-management.md +26 -19
  12. package/1.getting-started/12.error-handling.md +22 -20
  13. package/1.getting-started/13.server.md +8 -8
  14. package/1.getting-started/14.layers.md +22 -16
  15. package/1.getting-started/15.prerendering.md +32 -32
  16. package/1.getting-started/16.deployment.md +10 -10
  17. package/1.getting-started/17.testing.md +44 -44
  18. package/1.getting-started/18.upgrade.md +241 -110
  19. package/2.guide/0.index.md +7 -7
  20. package/2.guide/{2.directory-structure → 1.directory-structure}/.navigation.yml +1 -1
  21. package/2.guide/{2.directory-structure → 1.directory-structure}/0.nuxt.md +3 -3
  22. package/2.guide/1.directory-structure/0.output.md +18 -0
  23. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/.navigation.yml +1 -1
  24. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/1.assets.md +4 -4
  25. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/1.components.md +45 -28
  26. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/1.composables.md +13 -13
  27. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/1.layouts.md +19 -15
  28. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/1.middleware.md +31 -25
  29. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/1.pages.md +39 -37
  30. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/1.plugins.md +25 -25
  31. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/1.utils.md +7 -7
  32. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/3.app-config.md +18 -18
  33. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/3.app.md +7 -7
  34. package/2.guide/{2.directory-structure → 1.directory-structure}/1.app/3.error.md +6 -6
  35. package/2.guide/{2.directory-structure → 1.directory-structure}/1.content.md +7 -4
  36. package/2.guide/{2.directory-structure → 1.directory-structure}/1.modules.md +8 -8
  37. package/2.guide/{2.directory-structure → 1.directory-structure}/1.node_modules.md +2 -2
  38. package/2.guide/{2.directory-structure → 1.directory-structure}/1.public.md +2 -2
  39. package/2.guide/{2.directory-structure → 1.directory-structure}/1.server.md +35 -35
  40. package/2.guide/{2.directory-structure → 1.directory-structure}/1.shared.md +7 -7
  41. package/2.guide/{2.directory-structure → 1.directory-structure}/2.env.md +8 -8
  42. package/2.guide/{2.directory-structure → 1.directory-structure}/2.gitignore.md +1 -1
  43. package/2.guide/{2.directory-structure → 1.directory-structure}/2.nuxtignore.md +5 -4
  44. package/2.guide/{2.directory-structure → 1.directory-structure}/2.nuxtrc.md +4 -4
  45. package/2.guide/{2.directory-structure → 1.directory-structure}/3.nuxt-config.md +3 -3
  46. package/2.guide/{2.directory-structure → 1.directory-structure}/3.package.md +1 -1
  47. package/2.guide/{2.directory-structure → 1.directory-structure}/3.tsconfig.md +3 -3
  48. package/2.guide/{1.concepts → 2.concepts}/1.auto-imports.md +22 -22
  49. package/2.guide/{1.concepts → 2.concepts}/10.nuxt-lifecycle.md +17 -17
  50. package/2.guide/{1.concepts → 2.concepts}/2.vuejs-development.md +13 -13
  51. package/2.guide/{1.concepts → 2.concepts}/3.rendering.md +24 -22
  52. package/2.guide/{1.concepts → 2.concepts}/4.server-engine.md +6 -6
  53. package/2.guide/{1.concepts → 2.concepts}/5.modules.md +5 -5
  54. package/2.guide/{1.concepts → 2.concepts}/7.esm.md +22 -16
  55. package/2.guide/{1.concepts → 2.concepts}/8.typescript.md +12 -12
  56. package/2.guide/3.going-further/1.events.md +3 -3
  57. package/2.guide/3.going-further/1.experimental-features.md +334 -85
  58. package/2.guide/3.going-further/1.features.md +58 -11
  59. package/2.guide/3.going-further/1.internals.md +25 -25
  60. package/2.guide/3.going-further/10.runtime-config.md +12 -12
  61. package/2.guide/3.going-further/11.nightly-release-channel.md +1 -1
  62. package/2.guide/3.going-further/2.hooks.md +14 -14
  63. package/2.guide/3.going-further/3.modules.md +126 -108
  64. package/2.guide/3.going-further/4.kit.md +7 -7
  65. package/2.guide/3.going-further/6.nuxt-app.md +8 -8
  66. package/2.guide/3.going-further/7.layers.md +76 -59
  67. package/2.guide/3.going-further/9.debugging.md +2 -2
  68. package/2.guide/4.recipes/1.custom-routing.md +30 -30
  69. package/2.guide/4.recipes/2.vite-plugin.md +45 -4
  70. package/2.guide/4.recipes/3.custom-usefetch.md +13 -13
  71. package/2.guide/4.recipes/4.sessions-and-authentication.md +35 -21
  72. package/2.guide/5.best-practices/hydration.md +4 -4
  73. package/2.guide/5.best-practices/performance.md +17 -17
  74. package/3.api/1.components/1.client-only.md +6 -3
  75. package/3.api/1.components/1.nuxt-client-fallback.md +10 -7
  76. package/3.api/1.components/10.nuxt-picture.md +1 -1
  77. package/3.api/1.components/11.teleports.md +5 -2
  78. package/3.api/1.components/12.nuxt-route-announcer.md +9 -9
  79. package/3.api/1.components/13.nuxt-time.md +49 -18
  80. package/3.api/1.components/2.nuxt-page.md +6 -6
  81. package/3.api/1.components/3.nuxt-layout.md +15 -10
  82. package/3.api/1.components/4.nuxt-link.md +42 -22
  83. package/3.api/1.components/5.nuxt-loading-indicator.md +3 -3
  84. package/3.api/1.components/6.nuxt-error-boundary.md +12 -10
  85. package/3.api/2.composables/on-prehydrate.md +2 -2
  86. package/3.api/2.composables/use-app-config.md +1 -1
  87. package/3.api/2.composables/use-async-data.md +26 -22
  88. package/3.api/2.composables/use-cookie.md +29 -21
  89. package/3.api/2.composables/use-error.md +2 -2
  90. package/3.api/2.composables/use-fetch.md +62 -32
  91. package/3.api/2.composables/use-head-safe.md +7 -7
  92. package/3.api/2.composables/use-head.md +5 -5
  93. package/3.api/2.composables/use-hydration.md +6 -6
  94. package/3.api/2.composables/use-lazy-async-data.md +4 -4
  95. package/3.api/2.composables/use-lazy-fetch.md +4 -4
  96. package/3.api/2.composables/use-loading-indicator.md +12 -12
  97. package/3.api/2.composables/use-nuxt-app.md +22 -22
  98. package/3.api/2.composables/use-nuxt-data.md +8 -8
  99. package/3.api/2.composables/use-preview-mode.md +15 -18
  100. package/3.api/2.composables/use-request-event.md +1 -1
  101. package/3.api/2.composables/use-request-fetch.md +3 -3
  102. package/3.api/2.composables/use-request-header.md +1 -1
  103. package/3.api/2.composables/use-request-headers.md +4 -4
  104. package/3.api/2.composables/use-request-url.md +1 -1
  105. package/3.api/2.composables/use-response-header.md +9 -10
  106. package/3.api/2.composables/use-route-announcer.md +4 -4
  107. package/3.api/2.composables/use-route.md +1 -1
  108. package/3.api/2.composables/use-router.md +10 -8
  109. package/3.api/2.composables/use-runtime-config.md +11 -11
  110. package/3.api/2.composables/use-runtime-hook.md +2 -2
  111. package/3.api/2.composables/use-seo-meta.md +4 -4
  112. package/3.api/2.composables/use-server-seo-meta.md +6 -6
  113. package/3.api/2.composables/use-state.md +5 -5
  114. package/3.api/3.utils/$fetch.md +10 -8
  115. package/3.api/3.utils/abort-navigation.md +3 -3
  116. package/3.api/3.utils/add-route-middleware.md +5 -5
  117. package/3.api/3.utils/call-once.md +6 -6
  118. package/3.api/3.utils/clear-error.md +3 -3
  119. package/3.api/3.utils/clear-nuxt-data.md +3 -3
  120. package/3.api/3.utils/clear-nuxt-state.md +3 -3
  121. package/3.api/3.utils/create-error.md +2 -2
  122. package/3.api/3.utils/define-lazy-hydration-component.md +13 -13
  123. package/3.api/3.utils/define-nuxt-component.md +5 -5
  124. package/3.api/3.utils/define-nuxt-plugin.md +13 -13
  125. package/3.api/3.utils/define-nuxt-route-middleware.md +5 -5
  126. package/3.api/3.utils/define-page-meta.md +23 -23
  127. package/3.api/3.utils/define-route-rules.md +7 -7
  128. package/3.api/3.utils/navigate-to.md +11 -11
  129. package/3.api/3.utils/prefetch-components.md +1 -1
  130. package/3.api/3.utils/preload-components.md +1 -1
  131. package/3.api/3.utils/preload-route-components.md +2 -2
  132. package/3.api/3.utils/prerender-routes.md +3 -3
  133. package/3.api/3.utils/refresh-cookie.md +4 -4
  134. package/3.api/3.utils/refresh-nuxt-data.md +12 -7
  135. package/3.api/3.utils/reload-nuxt-app.md +3 -3
  136. package/3.api/3.utils/set-page-layout.md +1 -1
  137. package/3.api/3.utils/set-response-status.md +3 -3
  138. package/3.api/3.utils/show-error.md +5 -5
  139. package/3.api/3.utils/update-app-config.md +4 -3
  140. package/3.api/4.commands/add.md +1 -1
  141. package/3.api/4.commands/analyze.md +2 -1
  142. package/3.api/4.commands/build.md +2 -1
  143. package/3.api/4.commands/dev.md +5 -4
  144. package/3.api/4.commands/generate.md +3 -2
  145. package/3.api/4.commands/init.md +3 -2
  146. package/3.api/4.commands/module.md +4 -4
  147. package/3.api/4.commands/prepare.md +7 -2
  148. package/3.api/4.commands/preview.md +5 -4
  149. package/3.api/4.commands/test.md +40 -0
  150. package/3.api/4.commands/typecheck.md +5 -3
  151. package/3.api/4.commands/upgrade.md +3 -3
  152. package/3.api/5.kit/1.modules.md +123 -37
  153. package/3.api/5.kit/10.runtime-config.md +1 -1
  154. package/3.api/5.kit/10.templates.md +8 -6
  155. package/3.api/5.kit/11.nitro.md +66 -62
  156. package/3.api/5.kit/12.resolving.md +2 -2
  157. package/3.api/5.kit/14.builder.md +61 -4
  158. package/3.api/5.kit/15.examples.md +5 -7
  159. package/3.api/5.kit/16.layers.md +26 -26
  160. package/3.api/5.kit/3.compatibility.md +14 -14
  161. package/3.api/5.kit/4.autoimports.md +13 -13
  162. package/3.api/5.kit/5.components.md +8 -7
  163. package/3.api/5.kit/6.context.md +3 -3
  164. package/3.api/5.kit/7.pages.md +7 -7
  165. package/3.api/5.kit/8.layout.md +2 -2
  166. package/3.api/5.kit/9.head.md +132 -0
  167. package/3.api/5.kit/9.plugins.md +5 -4
  168. package/3.api/6.advanced/1.hooks.md +5 -5
  169. package/3.api/6.advanced/2.import-meta.md +3 -3
  170. package/3.api/6.nuxt-config.md +365 -859
  171. package/3.api/index.md +7 -7
  172. package/5.community/2.getting-help.md +1 -1
  173. package/5.community/3.reporting-bugs.md +3 -3
  174. package/5.community/4.contribution.md +11 -11
  175. package/5.community/5.framework-contribution.md +4 -4
  176. package/5.community/6.roadmap.md +2 -2
  177. package/6.bridge/1.overview.md +13 -13
  178. package/6.bridge/10.configuration.md +2 -1
  179. package/6.bridge/2.typescript.md +3 -3
  180. package/6.bridge/3.bridge-composition-api.md +8 -8
  181. package/6.bridge/4.plugins-and-middleware.md +9 -9
  182. package/6.bridge/5.nuxt3-compatible-api.md +20 -17
  183. package/6.bridge/6.meta.md +20 -19
  184. package/6.bridge/7.runtime-config.md +1 -1
  185. package/6.bridge/8.nitro.md +3 -3
  186. package/6.bridge/9.vite.md +4 -4
  187. package/7.migration/1.overview.md +2 -2
  188. package/7.migration/10.bundling.md +1 -1
  189. package/7.migration/11.server.md +3 -3
  190. package/7.migration/2.configuration.md +23 -21
  191. package/7.migration/20.module-authors.md +7 -7
  192. package/7.migration/3.auto-imports.md +3 -3
  193. package/7.migration/4.meta.md +21 -18
  194. package/7.migration/5.plugins-and-middleware.md +8 -8
  195. package/7.migration/6.pages-and-layouts.md +28 -24
  196. package/7.migration/7.component-options.md +18 -18
  197. package/7.migration/8.runtime-config.md +7 -7
  198. package/package.json +1 -1
  199. package/2.guide/2.directory-structure/0.output.md +0 -18
  200. /package/2.guide/{1.concepts → 2.concepts}/.navigation.yml +0 -0
  201. /package/2.guide/{1.concepts → 2.concepts}/9.code-style.md +0 -0
package/3.api/index.md CHANGED
@@ -7,25 +7,25 @@ surround: false
7
7
  ---
8
8
 
9
9
  ::card-group
10
- ::card{icon="i-lucide-box" title="Components" to="/docs/api/components/client-only"}
10
+ ::card{icon="i-lucide-box" title="Components" to="/docs/4.x/api/components/client-only"}
11
11
  Explore Nuxt built-in components for pages, layouts, head, and more.
12
12
  ::
13
- ::card{icon="i-lucide-arrow-left-right" title="Composables" to="/docs/api/composables/use-app-config"}
13
+ ::card{icon="i-lucide-arrow-left-right" title="Composables" to="/docs/4.x/api/composables/use-app-config"}
14
14
  Discover Nuxt composable functions for data-fetching, head management and more.
15
15
  ::
16
- ::card{icon="i-lucide-square-function" title="Utils" to="/docs/api/utils/dollarfetch"}
16
+ ::card{icon="i-lucide-square-function" title="Utils" to="/docs/4.x/api/utils/dollarfetch"}
17
17
  Learn about Nuxt utility functions for navigation, error handling and more.
18
18
  ::
19
- ::card{icon="i-lucide-square-terminal" title="Commands" to="/docs/api/commands/add"}
19
+ ::card{icon="i-lucide-square-terminal" title="Commands" to="/docs/4.x/api/commands/add"}
20
20
  List of Nuxt CLI commands to init, analyze, build, and preview your application.
21
21
  ::
22
- ::card{icon="i-lucide-package" title="Nuxt Kit" to="/docs/api/kit/modules"}
22
+ ::card{icon="i-lucide-package" title="Nuxt Kit" to="/docs/4.x/api/kit/modules"}
23
23
  Understand Nuxt Kit utilities to create modules and control Nuxt.
24
24
  ::
25
- ::card{icon="i-lucide-brain" title="Advanced" to="/docs/api/advanced/hooks"}
25
+ ::card{icon="i-lucide-brain" title="Advanced" to="/docs/4.x/api/advanced/hooks"}
26
26
  Go deep in Nuxt internals with Nuxt lifecycle hooks.
27
27
  ::
28
- ::card{icon="i-lucide-cog" title="Nuxt Configuration" to="/docs/api/nuxt-config"}
28
+ ::card{icon="i-lucide-cog" title="Nuxt Configuration" to="/docs/4.x/api/nuxt-config"}
29
29
  Explore all Nuxt configuration options to customize your application.
30
30
  ::
31
31
  ::
@@ -37,7 +37,7 @@ And finally, just ask the question! There's no need to [ask permission to ask a
37
37
 
38
38
  Something isn't working the way that the docs say that it should. You're not sure if it's a bug. You've searched through the [open issues](https://github.com/nuxt/nuxt/issues) and [discussions](https://github.com/nuxt/nuxt/discussions) but you can't find anything. (if there is a closed issue, please create a new one)
39
39
 
40
- We recommend taking a look at [how to report bugs](/docs/community/reporting-bugs). Nuxt is still in active development, and every issue helps make it better.
40
+ We recommend taking a look at [how to report bugs](/docs/4.x/community/reporting-bugs). Nuxt is still in active development, and every issue helps make it better.
41
41
 
42
42
  ## "I need professional help"
43
43
 
@@ -12,7 +12,7 @@ Here are a few key steps.
12
12
 
13
13
  ## Is It Really a Bug?
14
14
 
15
- Consider if you're looking to get help with something, or whether you think there's a bug with Nuxt itself. If it's the former, we'd love to help you - but the best way to do that is through [asking for help](/docs/community/getting-help) rather than reporting a bug.
15
+ Consider if you're looking to get help with something, or whether you think there's a bug with Nuxt itself. If it's the former, we'd love to help you - but the best way to do that is through [asking for help](/docs/4.x/community/getting-help) rather than reporting a bug.
16
16
 
17
17
  ## Search the Issues
18
18
 
@@ -31,8 +31,8 @@ If your issue concerns Vue or Vite, please try to reproduce it first with the Vu
31
31
  **Nuxt**:
32
32
 
33
33
  ::card-group
34
- :card{title="Nuxt on StackBlitz" icon="i-simple-icons-stackblitz" to="https://nuxt.new/s/v3" target="_blank"}
35
- :card{title="Nuxt on CodeSandbox" icon="i-simple-icons-codesandbox" to="https://nuxt.new/c/v3" target="_blank"}
34
+ :card{title="Nuxt on StackBlitz" icon="i-simple-icons-stackblitz" to="https://nuxt.new/s/v4" target="_blank"}
35
+ :card{title="Nuxt on CodeSandbox" icon="i-simple-icons-codesandbox" to="https://nuxt.new/c/v4" target="_blank"}
36
36
  ::
37
37
 
38
38
  **Vue**:
@@ -11,7 +11,7 @@ There is a range of different ways you might be able to contribute to the Nuxt e
11
11
  The Nuxt ecosystem includes many different projects and organizations:
12
12
 
13
13
  * [nuxt/](https://github.com/nuxt) - core repositories for the Nuxt framework itself. [**nuxt/nuxt**](https://github.com/nuxt/nuxt) contains the Nuxt framework (both versions 2 and 3).
14
- * [nuxt-modules/](https://github.com/nuxt-modules) - community-contributed and maintained modules and libraries. There is a [process to migrate a module](/docs/guide/going-further/modules/#joining-nuxt-modules-and-nuxtjs) to `nuxt-modules`. While these modules have individual maintainers, they are not dependent on a single person.
14
+ * [nuxt-modules/](https://github.com/nuxt-modules) - community-contributed and maintained modules and libraries. There is a [process to migrate a module](/docs/4.x/guide/going-further/modules/#joining-nuxt-modules-and-nuxtjs) to `nuxt-modules`. While these modules have individual maintainers, they are not dependent on a single person.
15
15
  * [unjs/](https://github.com/unjs) - many of these libraries are used throughout the Nuxt ecosystem. They are designed to be universal libraries that are framework- and environment-agnostic. We welcome contributions and usage by other frameworks and projects.
16
16
 
17
17
  ## How To Contribute
@@ -24,7 +24,7 @@ Check out the issues and discussions for the project you want to help. For examp
24
24
 
25
25
  Thank you for taking the time to create an issue! ❤️
26
26
 
27
- * **Reporting bugs**: Check out [our guide](/docs/community/reporting-bugs) for some things to do before opening an issue.
27
+ * **Reporting bugs**: Check out [our guide](/docs/4.x/community/reporting-bugs) for some things to do before opening an issue.
28
28
 
29
29
  * **Feature requests**: Check that there is not an existing issue or discussion covering the scope of the feature you have in mind. If the feature is to another part of the Nuxt ecosystem (such as a module), please consider raising a feature request there first. If the feature you have in mind is general or the API is not entirely clear, consider opening a discussion in the **Ideas** section to discuss with the community first.
30
30
 
@@ -42,7 +42,7 @@ If you're working on a feature, then we ask that you **open a feature request is
42
42
 
43
43
  For typo fixes, it's recommended to batch multiple typo fixes into one pull request to maintain a cleaner commit history.
44
44
 
45
- For bigger changes to Nuxt itself, we recommend that you first [create a Nuxt module](#create-a-module) and implement the feature there. This allows for quick proof-of-concept. You can then [create an RFC](#make-an-rfc) in the form of a discussion. As users adopt it and you gather feedback, it can then be refined and either added to Nuxt core or continue as a standalone module.
45
+ For bigger changes to Nuxt itself, we recommend that you first [create a Nuxt module](/docs/4.x/community/contribution#create-a-module) and implement the feature there. This allows for quick proof-of-concept. You can then [create an RFC](/docs/4.x/community/contribution#make-an-rfc) in the form of a discussion. As users adopt it and you gather feedback, it can then be refined and either added to Nuxt core or continue as a standalone module.
46
46
 
47
47
  #### Commit Conventions
48
48
 
@@ -58,7 +58,7 @@ If you are working in a project with a monorepo, like `nuxt/nuxt`, ensure that y
58
58
 
59
59
  If you don't know how to send a pull request, we recommend reading [the guide](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).
60
60
 
61
- When sending a pull request, make sure your PR's title also follows the [Commit Convention](#commit-conventions).
61
+ When sending a pull request, make sure your PR's title also follows the [Commit Convention](/docs/4.x/community/contribution#commit-conventions).
62
62
 
63
63
  If your PR fixes or resolves existing issues, please make sure you mention them in the PR description.
64
64
 
@@ -100,13 +100,13 @@ Our aim is ensuring quality and maintaining the joy of collaborating and communi
100
100
 
101
101
  ### Create a Module
102
102
 
103
- If you've built something with Nuxt that's cool, why not [extract it into a module](/docs/guide/going-further/modules), so it can be shared with others? We have [many excellent modules already](/modules), but there's always room for more.
103
+ If you've built something with Nuxt that's cool, why not [extract it into a module](/docs/4.x/guide/going-further/modules), so it can be shared with others? We have [many excellent modules already](/modules), but there's always room for more.
104
104
 
105
- If you need help while building it, feel free to [check in with us](/docs/community/getting-help).
105
+ If you need help while building it, feel free to [check in with us](/docs/4.x/community/getting-help).
106
106
 
107
107
  ### Make an RFC
108
108
 
109
- We highly recommend [creating a module](#create-a-module) first to test out big new features and gain community adoption.
109
+ We highly recommend [creating a module](/docs/4.x/community/contribution#create-a-module) first to test out big new features and gain community adoption.
110
110
 
111
111
  If you have done this already, or it's not appropriate to create a new module, then please start by creating a new discussion. Make sure it explains your thinking as clearly as possible. Include code examples or function signatures for new APIs. Reference existing issues or pain points with examples.
112
112
 
@@ -126,7 +126,7 @@ The following conventions are _required_ within the `nuxt/` organization and rec
126
126
 
127
127
  #### Module Conventions
128
128
 
129
- Modules should follow the [Nuxt module template](https://github.com/nuxt/starter/tree/module). See [module guide](/docs/guide/going-further/modules) for more information.
129
+ Modules should follow the [Nuxt module template](https://github.com/nuxt/starter/tree/module). See [module guide](/docs/4.x/guide/going-further/modules) for more information.
130
130
 
131
131
  #### Use Core `unjs/` Libraries
132
132
 
@@ -139,7 +139,7 @@ We recommend the following libraries which are used throughout the ecosystem:
139
139
 
140
140
  #### Use ESM Syntax and Default to `type: module`
141
141
 
142
- Most of the Nuxt ecosystem can consume ESM directly. In general we advocate that you avoid using CJS-specific code, such as `__dirname` and `require` statements. You can [read more about ESM](/docs/guide/concepts/esm).
142
+ Most of the Nuxt ecosystem can consume ESM directly. In general we advocate that you avoid using CJS-specific code, such as `__dirname` and `require` statements. You can [read more about ESM](/docs/4.x/guide/concepts/esm).
143
143
 
144
144
  #### What's Corepack
145
145
 
@@ -172,7 +172,7 @@ We recommend using [VS Code](https://code.visualstudio.com) along with the [ESLi
172
172
 
173
173
  #### No Prettier
174
174
 
175
- Since ESLint is already configured to format the code, there is no need to duplicate the functionality with Prettier. To format the code, you can run `yarn lint --fix`, `pnpm lint --fix`, or `bun run lint --fix` or referring the [ESLint section](#use-eslint) for IDE Setup.
175
+ Since ESLint is already configured to format the code, there is no need to duplicate the functionality with Prettier. To format the code, you can run `yarn lint --fix`, `pnpm lint --fix`, or `bun run lint --fix` or referring the [ESLint section](/docs/4.x/community/contribution#use-eslint) for IDE Setup.
176
176
 
177
177
  If you have Prettier installed in your editor, we recommend you disable it when working on the project to avoid conflict.
178
178
 
@@ -218,6 +218,6 @@ Here are some tips that may help improve your documentation:
218
218
  Nuxt will throw an error.
219
219
  ::
220
220
 
221
- ::read-more{to="/docs/community/framework-contribution#documentation-guide"}
221
+ ::read-more{to="/docs/4.x/community/framework-contribution#documentation-guide"}
222
222
  Learn how to contribute to the documentation.
223
223
  ::
@@ -4,7 +4,7 @@ navigation.icon: i-lucide-github
4
4
  description: Some specific points about contributions to the framework repository.
5
5
  ---
6
6
 
7
- Once you've read the [general contribution guide](/docs/community/contribution), here are some specific points to make about contributions to the [`nuxt/nuxt`](https://github.com/nuxt/nuxt) repository.
7
+ Once you've read the [general contribution guide](/docs/4.x/community/contribution), here are some specific points to make about contributions to the [`nuxt/nuxt`](https://github.com/nuxt/nuxt) repository.
8
8
 
9
9
  ## Monorepo Guide
10
10
 
@@ -42,7 +42,7 @@ To contribute to Nuxt, you need to set up a local environment.
42
42
  git checkout -b my-new-branch
43
43
  ```
44
44
 
45
- Then, test your changes against the [playground](#playground) and [test](#testing) your changes before submitting a pull request.
45
+ Then, test your changes against the [playground](/docs/4.x/community/framework-contribution#playground) and [test](/docs/4.x/community/framework-contribution#testing) your changes before submitting a pull request.
46
46
 
47
47
  ### Playground
48
48
 
@@ -88,7 +88,7 @@ If there are still errors left, you must correct them manually.
88
88
  If you are adding a new feature or refactoring or changing the behavior of Nuxt in any other manner, you'll likely want to document the changes. Please include any changes to the docs in the same PR. You don't have to write documentation up on the first commit (but please do so as soon as your pull request is mature enough).
89
89
 
90
90
  ::important
91
- Make sure to make changes according to the [Documentation Style Guide](/docs/community/contribution#documentation-style-guide).
91
+ Make sure to make changes according to the [Documentation Style Guide](/docs/4.x/community/contribution#documentation-style-guide).
92
92
  ::
93
93
 
94
94
  ### Final Checklist
@@ -100,7 +100,7 @@ When submitting your PR, there is a simple template that you have to fill out. P
100
100
  If you spot an area where we can improve documentation or error messages, please do open a PR - even if it's just to fix a typo!
101
101
 
102
102
  ::important
103
- Make sure to make changes according to the [Documentation Style Guide](/docs/community/contribution#documentation-style-guide).
103
+ Make sure to make changes according to the [Documentation Style Guide](/docs/4.x/community/contribution#documentation-style-guide).
104
104
  ::
105
105
 
106
106
  ### Quick Edits
@@ -32,7 +32,7 @@ Milestone | Expected date | Notes
32
32
  -------------|---------------|------------------------------------------------------------------------|-----------------------
33
33
  SEO & PWA | 2025 | [nuxt/nuxt#18395](https://github.com/nuxt/nuxt/discussions/18395) | Migrating from [nuxt-community/pwa-module](https://github.com/nuxt-community/pwa-module) for built-in SEO utils and service worker support
34
34
  Assets | 2025 | [nuxt/nuxt#22012](https://github.com/nuxt/nuxt/discussions/22012) | Allow developers and modules to handle loading third-party assets.
35
- Translations | - | [nuxt/translations#4](https://github.com/nuxt/translations/discussions/4) ([request access](https://github.com/nuxt/nuxt/discussions/16054)) | A collaborative project for a stable translation process for Nuxt docs. Currently pending for ideas and documentation tooling support (content v2 with remote sources).
35
+ Translations | - | [nuxt/nuxt.com#1711](https://github.com/nuxt/nuxt.com/issues/1711) | A collaborative project for a stable translation process for Nuxt docs. Currently pending for ideas and documentation tooling support.
36
36
 
37
37
  ## Core Modules Roadmap
38
38
 
@@ -63,7 +63,7 @@ The current active version of [Nuxt](https://nuxt.com) is **v4** which is availa
63
63
 
64
64
  Nuxt 3 will continue to receive maintenance updates (both bug fixes and backports of features from Nuxt 4) until the end of January 2026.
65
65
 
66
- Each active version has its own nightly releases which are generated automatically. For more about enabling the Nuxt nightly release channel, see [the nightly release channel docs](/docs/guide/going-further/nightly-release-channel).
66
+ Each active version has its own nightly releases which are generated automatically. For more about enabling the Nuxt nightly release channel, see [the nightly release channel docs](/docs/4.x/guide/going-further/nightly-release-channel).
67
67
 
68
68
  Release | | Initial release | End Of Life | Docs
69
69
  -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ---------------------------- | ---------------------------------------
@@ -4,11 +4,11 @@ description: Reduce the differences with Nuxt 3 and reduce the burden of migrati
4
4
  ---
5
5
 
6
6
  ::note
7
- If you're starting a fresh Nuxt 3 project, please skip this section and go to [Nuxt 3 Installation](/docs/getting-started/introduction).
7
+ If you're starting a fresh Nuxt 3 project, please skip this section and go to [Nuxt 3 Installation](/docs/4.x/getting-started/introduction).
8
8
  ::
9
9
 
10
10
  ::warning
11
- Nuxt Bridge provides identical features to Nuxt 3 ([docs](/docs/guide/concepts/auto-imports)) but there are some limitations, notably that [`useAsyncData`](/docs/api/composables/use-async-data) and [`useFetch`](/docs/api/composables/use-fetch) composables are not available. Please read the rest of this page for details.
11
+ Nuxt Bridge provides identical features to Nuxt 3 ([docs](/docs/4.x/guide/concepts/auto-imports)) but there are some limitations, notably that [`useAsyncData`](/docs/4.x/api/composables/use-async-data) and [`useFetch`](/docs/4.x/api/composables/use-fetch) composables are not available. Please read the rest of this page for details.
12
12
  ::
13
13
 
14
14
  Bridge is a forward-compatibility layer that allows you to experience many of the new Nuxt 3 features by simply installing and enabling a Nuxt module.
@@ -80,13 +80,13 @@ bun add -D @nuxt/bridge nuxi
80
80
 
81
81
  Please make sure to avoid any CommonJS syntax such as `module.exports`, `require` or `require.resolve` in your config file. It will soon be deprecated and unsupported.
82
82
 
83
- You can use static `import`, dynamic `import()` and `export default` instead. Using TypeScript by renaming to [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) is also possible and recommended.
83
+ You can use static `import`, dynamic `import()` and `export default` instead. Using TypeScript by renaming to [`nuxt.config.ts`](/docs/4.x/guide/directory-structure/nuxt-config) is also possible and recommended.
84
84
 
85
85
  ```ts [nuxt.config.ts]
86
86
  import { defineNuxtConfig } from '@nuxt/bridge'
87
87
 
88
88
  export default defineNuxtConfig({
89
- bridge: false
89
+ bridge: false,
90
90
  })
91
91
  ```
92
92
 
@@ -116,22 +116,22 @@ Try running `nuxt2` once here. You will see that the application works as before
116
116
  With Nuxt Bridge, the migration to Nuxt 3 can proceed in steps.
117
117
  The below `Upgrade Steps` does not need to be done all at once.
118
118
 
119
- - [TypeScript](/docs/bridge/typescript)
119
+ - [TypeScript](/docs/4.x/bridge/typescript)
120
120
 
121
- - [Migrate Legacy Composition API](/docs/bridge/bridge-composition-api)
121
+ - [Migrate Legacy Composition API](/docs/4.x/bridge/bridge-composition-api)
122
122
 
123
- - [Plugins and Middleware](/docs/bridge/plugins-and-middleware)
123
+ - [Plugins and Middleware](/docs/4.x/bridge/plugins-and-middleware)
124
124
 
125
- - [Migrate New Composition API](/docs/bridge/nuxt3-compatible-api)
125
+ - [Migrate New Composition API](/docs/4.x/bridge/nuxt3-compatible-api)
126
126
 
127
- - [Meta Tags](/docs/bridge/meta)
127
+ - [Meta Tags](/docs/4.x/bridge/meta)
128
128
 
129
- - [Runtime Config](/docs/bridge/runtime-config)
129
+ - [Runtime Config](/docs/4.x/bridge/runtime-config)
130
130
 
131
- - [Nitro](/docs/bridge/nitro)
131
+ - [Nitro](/docs/4.x/bridge/nitro)
132
132
 
133
- - [Vite](/docs/bridge/vite)
133
+ - [Vite](/docs/4.x/bridge/vite)
134
134
 
135
135
  ## Migrate from CommonJS to ESM
136
136
 
137
- Nuxt 3 natively supports TypeScript and ECMAScript Modules. Please check [Native ES Modules](/docs/guide/concepts/esm) for more info and upgrading.
137
+ Nuxt 3 natively supports TypeScript and ECMAScript Modules. Please check [Native ES Modules](/docs/4.x/guide/concepts/esm) for more info and upgrading.
@@ -11,6 +11,7 @@ You can check [bridge/src/module.ts](https://github.com/nuxt/bridge/blob/main/pa
11
11
 
12
12
  ```ts [nuxt.config.ts]
13
13
  import { defineNuxtConfig } from '@nuxt/bridge'
14
+
14
15
  export default defineNuxtConfig({
15
16
  bridge: {
16
17
 
@@ -63,7 +64,7 @@ export default defineNuxtConfig({
63
64
 
64
65
  vite: {
65
66
  // Config for Vite
66
- }
67
+ },
67
68
  })
68
69
  ```
69
70
 
@@ -16,8 +16,8 @@ import { defineNuxtConfig } from '@nuxt/bridge'
16
16
  export default defineNuxtConfig({
17
17
  bridge: {
18
18
  typescript: true,
19
- nitro: false // If migration to Nitro is complete, set to true
20
- }
19
+ nitro: false, // If migration to Nitro is complete, set to true
20
+ },
21
21
  })
22
22
  ```
23
23
 
@@ -37,7 +37,7 @@ If you are using TypeScript, you can edit your `tsconfig.json` to benefit from a
37
37
  ::note
38
38
  As `.nuxt/tsconfig.json` is generated and not checked into version control, you'll need to generate that file before running your tests. Add `nuxi prepare` as a step before your tests, otherwise you'll see `TS5083: Cannot read file '~/.nuxt/tsconfig.json'`
39
39
 
40
- For modern Nuxt projects, we recommend using [TypeScript project references](/docs/guide/directory-structure/tsconfig) instead of directly extending `.nuxt/tsconfig.json`.
40
+ For modern Nuxt projects, we recommend using [TypeScript project references](/docs/4.x/guide/directory-structure/tsconfig) instead of directly extending `.nuxt/tsconfig.json`.
41
41
  ::
42
42
 
43
43
  ::note
@@ -35,9 +35,9 @@ Because some composables have been removed and don't yet have a replacement, thi
35
35
 
36
36
  You don't have to immediately update your imports yet - Nuxt Bridge will automatically provide a 'shim' for most imports you currently have, to give you time to migrate to the new, Nuxt 3-compatible composables, with the following exceptions:
37
37
 
38
- - `withContext` has been removed. See [below](/docs/bridge/nuxt3-compatible-api#usecontext-and-withcontext).
38
+ - `withContext` has been removed. See [below](/docs/4.x/bridge/nuxt3-compatible-api#usecontext-and-withcontext).
39
39
  - `useStatic` has been removed. There is no current replacement. Feel free to raise a discussion if you have a use case for this.
40
- - `reqRef` and `reqSsrRef`, which were deprecated, have now been removed entirely. Follow the instructions below regarding [ssrRef](/docs/bridge/nuxt3-compatible-api#ssrref-and-shallowssrref) to replace this.
40
+ - `reqRef` and `reqSsrRef`, which were deprecated, have now been removed entirely. Follow the instructions below regarding [ssrRef](/docs/4.x/bridge/nuxt3-compatible-api#ssrref-and-shallowssrref) to replace this.
41
41
 
42
42
  ### Set `bridge.capi`
43
43
 
@@ -47,8 +47,8 @@ import { defineNuxtConfig } from '@nuxt/bridge'
47
47
  export default defineNuxtConfig({
48
48
  bridge: {
49
49
  capi: true,
50
- nitro: false // If migration to Nitro is complete, set to true
51
- }
50
+ nitro: false, // If migration to Nitro is complete, set to true
51
+ },
52
52
  })
53
53
  ```
54
54
 
@@ -91,7 +91,7 @@ export default <Middleware> function (ctx) { }
91
91
 
92
92
  This was a type-helper stub function that is now removed.
93
93
 
94
- You may also keep using Nuxt 2-style plugins, by removing the function (as with [defineNuxtMiddleware](#definenuxtmiddleware)).
94
+ You may also keep using Nuxt 2-style plugins, by removing the function (as with [defineNuxtMiddleware](/docs/4.x/bridge/bridge-composition-api#definenuxtmiddleware)).
95
95
 
96
96
  Remove the `defineNuxtPlugin` wrapper:
97
97
 
@@ -113,13 +113,13 @@ export default <Plugin> function (ctx, inject) {}
113
113
  While this example is valid, Nuxt 3 introduces a new defineNuxtPlugin function that has a slightly different signature.
114
114
  ::
115
115
 
116
- :ReadMore{link="/docs/guide/directory-structure/app/plugins#creating-plugins"}
116
+ :ReadMore{link="/docs/4.x/guide/directory-structure/app/plugins#creating-plugins"}
117
117
 
118
118
  ### `useRouter` and `useRoute`
119
119
 
120
- Nuxt Bridge provides direct replacements for these composables via [`useRouter`](/docs/api/composables/use-router) and `useRoute`.
120
+ Nuxt Bridge provides direct replacements for these composables via [`useRouter`](/docs/4.x/api/composables/use-router) and `useRoute`.
121
121
 
122
- The only key difference is that [`useRoute`](/docs/api/composables/use-route) no longer returns a computed property.
122
+ The only key difference is that [`useRoute`](/docs/4.x/api/composables/use-route) no longer returns a computed property.
123
123
 
124
124
  ```diff
125
125
  - import { useRouter, useRoute } from '@nuxtjs/composition-api'
@@ -7,17 +7,17 @@ description: 'Learn how to migrate from Nuxt 2 to Nuxt Bridge new plugins and mi
7
7
 
8
8
  You can now migrate to the Nuxt 3 plugins API, which is slightly different in format from Nuxt 2.
9
9
 
10
- Plugins now take only one argument (`nuxtApp`). You can find out more in [the docs](/docs/guide/directory-structure/plugins).
10
+ Plugins now take only one argument (`nuxtApp`). You can find out more in [the docs](/docs/4.x/guide/directory-structure/plugins).
11
11
 
12
- ```js [app/plugins/hello.ts]
13
- export default defineNuxtPlugin(nuxtApp => {
12
+ ```ts [app/plugins/hello.ts]
13
+ export default defineNuxtPlugin((nuxtApp) => {
14
14
  nuxtApp.provide('injected', () => 'my injected function')
15
15
  // now available on `nuxtApp.$injected`
16
16
  })
17
17
  ```
18
18
 
19
19
  ::note
20
- If you want to use the new Nuxt composables (such as [`useNuxtApp`](/docs/api/composables/use-nuxt-app) or `useRuntimeConfig`) within your plugins, you will need to use the `defineNuxtPlugin` helper for those plugins.
20
+ If you want to use the new Nuxt composables (such as [`useNuxtApp`](/docs/4.x/api/composables/use-nuxt-app) or `useRuntimeConfig`) within your plugins, you will need to use the `defineNuxtPlugin` helper for those plugins.
21
21
  ::
22
22
 
23
23
  ::warning
@@ -28,7 +28,7 @@ Although a compatibility interface is provided via `nuxtApp.vueApp` you should a
28
28
 
29
29
  You can now migrate to the Nuxt 3 middleware API, which is slightly different in format from Nuxt 2.
30
30
 
31
- Middleware now take only two argument (`to`, `from`). You can find out more in [the docs](/docs/guide/directory-structure/app/middleware).
31
+ Middleware now take only two argument (`to`, `from`). You can find out more in [the docs](/docs/4.x/guide/directory-structure/app/middleware).
32
32
 
33
33
  ```ts twoslash
34
34
  export default defineNuxtRouteMiddleware((to) => {
@@ -44,7 +44,7 @@ Use of `defineNuxtRouteMiddleware` is not supported outside of the `app/middlewa
44
44
 
45
45
  ## definePageMeta
46
46
 
47
- You can also use [`definePageMeta`](/docs/api/utils/define-page-meta) in Nuxt Bridge.
47
+ You can also use [`definePageMeta`](/docs/4.x/api/utils/define-page-meta) in Nuxt Bridge.
48
48
 
49
49
  You can be enabled with the `macros.pageMeta` option in your configuration file
50
50
 
@@ -54,9 +54,9 @@ import { defineNuxtConfig } from '@nuxt/bridge'
54
54
  export default defineNuxtConfig({
55
55
  bridge: {
56
56
  macros: {
57
- pageMeta: true
58
- }
59
- }
57
+ pageMeta: true,
58
+ },
59
+ },
60
60
  })
61
61
  ```
62
62
 
@@ -9,7 +9,7 @@ By migrating from `@nuxtjs/composition-api` to the Nuxt 3 compatible API, there
9
9
 
10
10
  These two functions have been replaced with a new composable that works very similarly under the hood: `useState`.
11
11
 
12
- The key differences are that you must provide a _key_ for this state (which Nuxt generated automatically for `ssrRef` and `shallowSsrRef`), and that it can only be called within a Nuxt 3 plugin (which is defined by `defineNuxtPlugin`) or a component instance. (In other words, you cannot use [`useState`](/docs/api/composables/use-state) with a global/ambient context, because of the danger of shared state across requests.)
12
+ The key differences are that you must provide a _key_ for this state (which Nuxt generated automatically for `ssrRef` and `shallowSsrRef`), and that it can only be called within a Nuxt 3 plugin (which is defined by `defineNuxtPlugin`) or a component instance. (In other words, you cannot use [`useState`](/docs/4.x/api/composables/use-state) with a global/ambient context, because of the danger of shared state across requests.)
13
13
 
14
14
  ```diff
15
15
  - import { ssrRef } from '@nuxtjs/composition-api'
@@ -24,7 +24,7 @@ The key differences are that you must provide a _key_ for this state (which Nuxt
24
24
 
25
25
  Because the state is keyed, you can access the same state from multiple locations, as long as you are using the same key.
26
26
 
27
- You can read more about how to use this composable in [the Nuxt 3 docs](/docs/api/composables/use-state).
27
+ You can read more about how to use this composable in [the Nuxt 3 docs](/docs/4.x/api/composables/use-state).
28
28
 
29
29
  ## `ssrPromise`
30
30
 
@@ -32,7 +32,7 @@ This function has been removed, and you will need to find an alternative impleme
32
32
 
33
33
  ## `onGlobalSetup`
34
34
 
35
- This function has been removed, but its use cases can be met by using [`useNuxtApp`](/docs/api/composables/use-nuxt-app) or [`useState`](/docs/api/composables/use-state) within `defineNuxtPlugin`. You can also run any custom code within the `setup()` function of a layout.
35
+ This function has been removed, but its use cases can be met by using [`useNuxtApp`](/docs/4.x/api/composables/use-nuxt-app) or [`useState`](/docs/4.x/api/composables/use-state) within `defineNuxtPlugin`. You can also run any custom code within the `setup()` function of a layout.
36
36
 
37
37
  ```diff
38
38
  - import { onGlobalSetup } from '@nuxtjs/composition-api'
@@ -73,8 +73,10 @@ You can access injected helpers using `useNuxtApp`.
73
73
 
74
74
  This helper function is not provided any more but you can replace it with the following code:
75
75
 
76
- ```js
77
- const wrapProperty = (property, makeComputed = true) => () => {
76
+ ```ts
77
+ import { computed, getCurrentInstance } from 'vue'
78
+
79
+ const wrapProperty = (property: string, makeComputed = true) => () => {
78
80
  const vm = getCurrentInstance().proxy
79
81
  return makeComputed ? computed(() => vm[property]) : vm[property]
80
82
  }
@@ -82,14 +84,14 @@ const wrapProperty = (property, makeComputed = true) => () => {
82
84
 
83
85
  ## `useAsync` and `useFetch`
84
86
 
85
- These two composables can be replaced with `useLazyAsyncData` and `useLazyFetch`, which are documented [in the Nuxt 3 docs](/docs/getting-started/data-fetching). Just like the previous `@nuxtjs/composition-api` composables, these composables do not block route navigation on the client-side (hence the 'lazy' part of the name).
87
+ These two composables can be replaced with `useLazyAsyncData` and `useLazyFetch`, which are documented [in the Nuxt 3 docs](/docs/4.x/getting-started/data-fetching). Just like the previous `@nuxtjs/composition-api` composables, these composables do not block route navigation on the client-side (hence the 'lazy' part of the name).
86
88
 
87
89
  ::important
88
90
  Note that the API is entirely different, despite similar sounding names. Importantly, you should not attempt to change the value of other variables outside the composable (as you may have been doing with the previous `useFetch`).
89
91
  ::
90
92
 
91
93
  ::warning
92
- The `useLazyFetch` must have been configured for [Nitro](/docs/bridge/nitro).
94
+ The `useLazyFetch` must have been configured for [Nitro](/docs/4.x/bridge/nitro).
93
95
  ::
94
96
 
95
97
  Migrating to the new composables from `useAsync`:
@@ -136,7 +138,7 @@ In order to interact with `vue-meta`, you may use `useNuxt2Meta`, which will wor
136
138
 
137
139
  You can also pass in computed values or refs, and the meta values will be updated reactively:
138
140
 
139
- ```ts
141
+ ```vue
140
142
  <script setup>
141
143
  const title = ref('my title')
142
144
  useNuxt2Meta({
@@ -150,7 +152,7 @@ title.value = 'new title'
150
152
  Be careful not to use both `useNuxt2Meta()` and the Options API `head()` within the same component, as behavior may be unpredictable.
151
153
  ::
152
154
 
153
- Nuxt Bridge also provides a Nuxt 3-compatible meta implementation that can be accessed with the [`useHead`](/docs/api/composables/use-head) composable.
155
+ Nuxt Bridge also provides a Nuxt 3-compatible meta implementation that can be accessed with the [`useHead`](/docs/4.x/api/composables/use-head) composable.
154
156
 
155
157
  ```diff
156
158
  <script setup>
@@ -165,16 +167,17 @@ You will also need to enable it explicitly in your `nuxt.config`:
165
167
 
166
168
  ```js
167
169
  import { defineNuxtConfig } from '@nuxt/bridge'
170
+
168
171
  export default defineNuxtConfig({
169
172
  bridge: {
170
- meta: true
171
- }
173
+ meta: true,
174
+ },
172
175
  })
173
176
  ```
174
177
 
175
- This [`useHead`](/docs/api/composables/use-head) composable uses `@unhead/vue` under the hood (rather than `vue-meta`) to manipulate your `<head>`. Accordingly, it is recommended not to use both the native Nuxt 2 `head()` properties as well as [`useHead`](/docs/api/composables/use-head) , as they may conflict.
178
+ This [`useHead`](/docs/4.x/api/composables/use-head) composable uses `@unhead/vue` under the hood (rather than `vue-meta`) to manipulate your `<head>`. Accordingly, it is recommended not to use both the native Nuxt 2 `head()` properties as well as [`useHead`](/docs/4.x/api/composables/use-head) , as they may conflict.
176
179
 
177
- For more information on how to use this composable, see [the Nuxt 3 docs](/docs/getting-started/seo-meta).
180
+ For more information on how to use this composable, see [the Nuxt 3 docs](/docs/4.x/getting-started/seo-meta).
178
181
 
179
182
  ### Explicit Imports
180
183
 
@@ -182,7 +185,7 @@ Nuxt exposes every auto-import with the `#imports` alias that can be used to mak
182
185
 
183
186
  ```vue
184
187
  <script setup lang="ts">
185
- import { ref, computed } from '#imports'
188
+ import { computed, ref } from '#imports'
186
189
 
187
190
  const count = ref(1)
188
191
  const double = computed(() => count.value * 2)
@@ -196,9 +199,9 @@ If you want to disable auto-importing composables and utilities, you can set `im
196
199
  ```ts [nuxt.config.ts]
197
200
  export default defineNuxtConfig({
198
201
  imports: {
199
- autoImport: false
200
- }
202
+ autoImport: false,
203
+ },
201
204
  })
202
205
  ```
203
206
 
204
- This will disable auto-imports completely but it's still possible to use [explicit imports](#explicit-imports) from `#imports`.
207
+ This will disable auto-imports completely but it's still possible to use [explicit imports](/docs/4.x/bridge/nuxt3-compatible-api#explicit-imports) from `#imports`.
@@ -3,7 +3,7 @@ title: Meta Tags
3
3
  description: 'Learn how to migrate from Nuxt 2 to Nuxt Bridge new meta tags.'
4
4
  ---
5
5
 
6
- If you need to access the component state with `head`, you should migrate to using [`useHead`](/docs/api/composables/use-head) .
6
+ If you need to access the component state with `head`, you should migrate to using [`useHead`](/docs/4.x/api/composables/use-head) .
7
7
 
8
8
  If you need to use the Options API, there is a `head()` method you can use when you use `defineNuxtComponent`.
9
9
 
@@ -13,11 +13,12 @@ If you need to use the Options API, there is a `head()` method you can use when
13
13
 
14
14
  ```js
15
15
  import { defineNuxtConfig } from '@nuxt/bridge'
16
+
16
17
  export default defineNuxtConfig({
17
18
  bridge: {
18
19
  meta: true,
19
- nitro: false // If migration to Nitro is complete, set to true
20
- }
20
+ nitro: false, // If migration to Nitro is complete, set to true
21
+ },
21
22
  })
22
23
  ```
23
24
 
@@ -34,9 +35,9 @@ export default {
34
35
  meta: [
35
36
  { charset: 'utf-8' },
36
37
  { name: 'viewport', content: 'width=device-width, initial-scale=1' },
37
- { hid: 'description', name: 'description', content: 'Meta description' }
38
- ]
39
- }
38
+ { hid: 'description', name: 'description', content: 'Meta description' },
39
+ ],
40
+ },
40
41
  }
41
42
  ```
42
43
 
@@ -48,10 +49,10 @@ export default defineNuxtConfig({
48
49
  meta: [
49
50
  { charset: 'utf-8' },
50
51
  { name: 'viewport', content: 'width=device-width, initial-scale=1' },
51
- { name: 'description', content: 'Meta description' }
52
- ]
53
- }
54
- }
52
+ { name: 'description', content: 'Meta description' },
53
+ ],
54
+ },
55
+ },
55
56
  })
56
57
  ```
57
58
 
@@ -59,7 +60,7 @@ export default defineNuxtConfig({
59
60
 
60
61
  ## `useHead` Composables
61
62
 
62
- Nuxt Bridge provides a new Nuxt 3 meta API that can be accessed with a new [`useHead`](/docs/api/composables/use-head) composable.
63
+ Nuxt Bridge provides a new Nuxt 3 meta API that can be accessed with a new [`useHead`](/docs/4.x/api/composables/use-head) composable.
63
64
 
64
65
  ```vue
65
66
  <script setup lang="ts">
@@ -70,14 +71,14 @@ useHead({
70
71
  ```
71
72
 
72
73
  ::tip
73
- This [`useHead`](/docs/api/composables/use-head) composable uses `@unhead/vue` under the hood (rather than `vue-meta`) to manipulate your `<head>`.
74
+ This [`useHead`](/docs/4.x/api/composables/use-head) composable uses `@unhead/vue` under the hood (rather than `vue-meta`) to manipulate your `<head>`.
74
75
  ::
75
76
 
76
77
  ::warning
77
- We recommend not using the native Nuxt 2 `head()` properties in addition to [`useHead`](/docs/api/composables/use-head) , as they may conflict.
78
+ We recommend not using the native Nuxt 2 `head()` properties in addition to [`useHead`](/docs/4.x/api/composables/use-head) , as they may conflict.
78
79
  ::
79
80
 
80
- For more information on how to use this composable, see [the docs](/docs/getting-started/seo-meta).
81
+ For more information on how to use this composable, see [the docs](/docs/4.x/getting-started/seo-meta).
81
82
 
82
83
  ## Options API
83
84
 
@@ -90,10 +91,10 @@ export default defineNuxtComponent({
90
91
  return {
91
92
  meta: [{
92
93
  name: 'description',
93
- content: 'This is my page description.'
94
- }]
94
+ content: 'This is my page description.',
95
+ }],
95
96
  }
96
- }
97
+ },
97
98
  })
98
99
  </script>
99
100
  ```
@@ -110,8 +111,8 @@ If you want to use a function (for full control), then this cannot be set in you
110
111
  <script setup lang="ts">
111
112
  useHead({
112
113
  titleTemplate: (titleChunk) => {
113
- return titleChunk ? `${titleChunk} - Site Title` : 'Site Title';
114
- }
114
+ return titleChunk ? `${titleChunk} - Site Title` : 'Site Title'
115
+ },
115
116
  })
116
117
  </script>
117
118
  ```