diff --git a/docs/2.guide/2.directory-structure/1.shared.md b/docs/2.guide/2.directory-structure/1.shared.md index f1b94243e1..5c8330d31c 100644 --- a/docs/2.guide/2.directory-structure/1.shared.md +++ b/docs/2.guide/2.directory-structure/1.shared.md @@ -12,7 +12,7 @@ The `shared/` directory is available in Nuxt v3.14+. :: ::important -Code in the shared directory cannot import any Vue or nitro code. +Code in the `shared/` directory cannot import any Vue or Nitro code. :: ## Usage @@ -59,7 +59,13 @@ export default defineEventHandler((event) => { ## Auto Imports -Only files in the `shared/utils/` and `shared/types/` directories will be auto-imported. Files nested in directories within `shared/utils/` or `shared/types/` will not be auto-imported. +Only files in the `shared/utils/` and `shared/types/` directories will be auto-imported. Files nested within subdirectories of these directories will not be auto-imported. + +::tip +The way `shared/utils` and `shared/types` auto-imports work and are scanned is identical to the [`composables/`](/docs/guide/directory-structure/composables) and [`utils/`](/docs/guide/directory-structure/utils) directories. +:: + +:read-more{to="/docs/guide/directory-structure/composables#how-files-are-scanned"} ```bash [Directory Structure] -| shared/ @@ -74,7 +80,7 @@ Only files in the `shared/utils/` and `shared/types/` directories will be auto-i -----| bar.d.ts # Auto-imported ``` -Any other files you create in the shared folder must be manually imported using the `#shared` alias (automatically configured by Nuxt): +Any other files you create in the `shared/` folder must be manually imported using the `#shared` alias (automatically configured by Nuxt): ```ts // For files directly in the shared directory