diff --git a/docs/1.getting-started/9.layers.md b/docs/1.getting-started/9.layers.md index 4fade99fe4..e1fec4fd91 100644 --- a/docs/1.getting-started/9.layers.md +++ b/docs/1.getting-started/9.layers.md @@ -18,7 +18,7 @@ One of the core features of Nuxt is the layers and extending support. You can ex ## Usage -By default, any layers within your project in the `~/layers` directory will be automatically registered as layers in your project +By default, any layers within your project in the `~~/layers` directory will be automatically registered as layers in your project ::note Layer auto-registration was introduced in Nuxt v3.12.0 diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 7014ba7d61..6175391357 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -454,7 +454,7 @@ async function initNuxt (nuxt: Nuxt) { ...nuxt.options._layers.filter(i => i.cwd.includes('node_modules')).map(i => i.cwd as string), ) - // Ensure we can resolve dependencies within layers - filtering out local `~/layers` directories + // Ensure we can resolve dependencies within layers - filtering out local `~~/layers` directories const locallyScannedLayersDirs = nuxt.options._layers.map(l => resolve(l.cwd, 'layers').replace(/\/?$/, '/')) nuxt.options.modulesDir.push(...nuxt.options._layers .filter(l => l.cwd !== nuxt.options.rootDir && locallyScannedLayersDirs.every(dir => !l.cwd.startsWith(dir)))