diff --git a/docs/2.guide/2.directory-structure/1.plugins.md b/docs/2.guide/2.directory-structure/1.plugins.md index 091b3e68a4..32764378a4 100644 --- a/docs/2.guide/2.directory-structure/1.plugins.md +++ b/docs/2.guide/2.directory-structure/1.plugins.md @@ -67,20 +67,24 @@ If you are using an object-syntax plugin, the properties may be statically analy ## Plugin Registration Order -You can control the order in which plugins are registered by prefixing a number to the file names. +You can control the order in which plugins are registered by prefixing with 'alphabetical' numbering to the file names. For example: ```bash plugins/ - | - 1.myPlugin.ts - | - 2.myOtherPlugin.ts + | - 01.myPlugin.ts + | - 02.myOtherPlugin.ts ``` -In this example, `2.myOtherPlugin.ts` will be able to access anything that was injected by `1.myPlugin.ts`. +In this example, `02.myOtherPlugin.ts` will be able to access anything that was injected by `01.myPlugin.ts`. This is useful in situations where you have a plugin that depends on another plugin. +::alert{type=info icon=💡} +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`. +:: + ## Using Composables Within Plugins You can use [composables](/docs/guide/directory-structure/composables) within Nuxt plugins: