mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
docs: document parallel
option on plugins (#21622)
This commit is contained in:
parent
a0c2363616
commit
794449f469
@ -85,6 +85,20 @@ This is useful in situations where you have a plugin that depends on another plu
|
||||
In case you're new to 'alphabetical' numbering, remember that filenames are sorted as strings, not as numeric values. For example, `10.myPlugin.ts` would come before `2.myOtherPlugin.ts`. This is why the example prefixes single digit numbers with `0`.
|
||||
::
|
||||
|
||||
## Loading strategy
|
||||
|
||||
By default, Nuxt loads plugins sequentially. You can define a plugin as `parallel` so Nuxt won't wait the end of the plugin's execution before loading the next plugin.
|
||||
|
||||
```ts
|
||||
export default defineNuxtPlugin({
|
||||
name: 'my-plugin',
|
||||
parallel: true,
|
||||
async setup (nuxtApp) {
|
||||
// the next plugin will be executed immediatly
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Using Composables Within Plugins
|
||||
|
||||
You can use [composables](/docs/guide/directory-structure/composables) within Nuxt plugins:
|
||||
|
Loading…
Reference in New Issue
Block a user