Skip to content

Commit

Permalink
docs: document parallel option on plugins (#21622)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien committed Jun 18, 2023
1 parent a0c2363 commit 794449f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/2.guide/2.directory-structure/1.plugins.md
Expand Up @@ -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:
Expand Down

0 comments on commit 794449f

Please sign in to comment.