@nuxt/docs-nightly 5.0.0-2611141908-7c351c3 → 5.0.0-2611142016-4eafd74
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.
|
@@ -405,7 +405,7 @@ bun add -D jiti
|
|
|
405
405
|
|
|
406
406
|
::
|
|
407
407
|
|
|
408
|
-
|
|
408
|
+
`nuxt.schema` files are imported by the runtime in the same way, and Nuxt reads their JSDoc annotations as they are imported. So they follow the same rules as config files: a `nuxt.schema.ts` inside `node_modules`, such as one shipped by a published layer, is loaded through `jiti`. On a runtime without `module.registerHooks()`, such as Bun, every `nuxt.schema` file is loaded through `jiti`.
|
|
409
409
|
|
|
410
410
|
One smaller change comes with this: PostCSS plugins named in `postcss.plugins` are now resolved by the runtime, so a plugin name that only resolves through a Nuxt `alias` entry no longer loads. Use the package name, or a path.
|
|
411
411
|
|
|
@@ -79,8 +79,8 @@ export default defineNuxtPlugin({
|
|
|
79
79
|
:video-accordion{title="Watch a video from Alexander Lichter about the Object Syntax for Nuxt plugins" videoId="2aXZyXB1QGQ"}
|
|
80
80
|
|
|
81
81
|
::note
|
|
82
|
-
If you are using the object-syntax,
|
|
83
|
-
For example, setting `enforce: import.meta.server ? 'pre' : 'post'` would defeat any
|
|
82
|
+
If you are using the object-syntax, `name`, `enforce`, `order`, `parallel` and `dependsOn` are statically analyzed at build time. Pass the object directly to `defineNuxtPlugin`, and use literal values (or top-level `const` variables in the same file that are initialized with one). Otherwise, Nuxt warns and resolves `name`, `dependsOn` and `parallel` at runtime instead, which produces a less optimized build. :br
|
|
83
|
+
For example, setting `enforce: import.meta.server ? 'pre' : 'post'` would defeat any optimization Nuxt is able to do for your plugins.
|
|
84
84
|
Nuxt does statically pre-load any hook listeners when using object-syntax, allowing you to define hooks without needing to worry about order of plugin registration.
|
|
85
85
|
::
|
|
86
86
|
|
|
@@ -132,6 +132,8 @@ export default defineNuxtPlugin({
|
|
|
132
132
|
})
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
+
If plugins depend on each other in a cycle, `nuxt build` fails. In development, Nuxt warns and ignores one of the dependencies to break the cycle.
|
|
136
|
+
|
|
135
137
|
## Using Composables
|
|
136
138
|
|
|
137
139
|
You can use [composables](/docs/directory-structure/app/composables) as well as [utils](/docs/directory-structure/app/utils) within Nuxt plugins:
|