diff --git a/docs/2.guide/3.going-further/3.modules.md b/docs/2.guide/3.going-further/3.modules.md index fe493bc39b..2891ce931a 100644 --- a/docs/2.guide/3.going-further/3.modules.md +++ b/docs/2.guide/3.going-further/3.modules.md @@ -335,6 +335,22 @@ export default defineNuxtModule({ }) ``` +Alternatively, you can add an entire directory by using `addComponentsDir`. + +```ts +import { defineNuxtModule, addComponentsDir } from '@nuxt/kit' + +export default defineNuxtModule({ + setup(options, nuxt) { + const resolver = createResolver(import.meta.url) + + addComponentsDir({ + path: resolver.resolve('runtime/components') + }) + } +}) +``` + #### Injecting Composables With `addImports` and `addImportsDir` If your module should provide composables, you can use the `addImports` utility to add them as auto-imports for Nuxt to resolve.