@nuxt/docs-nightly 4.2.0-29344151.f836eca0 → 4.2.0-29344217.2658cf12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -234,22 +234,30 @@ export default defineNuxtConfig({
234
234
 
235
235
  ## Multi-Layer Support for Nuxt Modules
236
236
 
237
- You can use the internal array `nuxt.options._layers` to support custom multi-layer handling for your modules.
237
+ You can use the [`getLayerDirectories`](/docs/4.x/api/kit/layers#getlayerdirectories) utility from Nuxt Kit to support custom multi-layer handling for your modules.
238
238
 
239
239
  ```ts [modules/my-module.ts]
240
+ import { defineNuxtModule, getLayerDirectories } from 'nuxt/kit'
241
+
240
242
  export default defineNuxtModule({
241
243
  setup (_options, nuxt) {
242
- for (const layer of nuxt.options._layers) {
243
- // You can check for a custom directory existence to extend for each layer
244
- console.log('Custom extension for', layer.cwd, layer.config)
244
+ const layerDirs = getLayerDirectories()
245
+
246
+ for (const [index, layer] of layerDirs.entries()) {
247
+ console.log(`Layer ${index}:`)
248
+ console.log(` Root: ${layer.root}`)
249
+ console.log(` App: ${layer.app}`)
250
+ console.log(` Server: ${layer.server}`)
251
+ console.log(` Pages: ${layer.appPages}`)
252
+ // ... other directories
245
253
  }
246
254
  },
247
255
  })
248
256
  ```
249
257
 
250
258
  **Notes:**
251
- - Earlier items in the `_layers` array have higher priority and override later ones
252
- - The user's project is the first item in the `_layers` array
259
+ - Earlier items in the array have higher priority and override later ones
260
+ - The user's project is the first item in the array
253
261
 
254
262
  ## Going Deeper
255
263
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/docs-nightly",
3
- "version": "4.2.0-29344151.f836eca0",
3
+ "version": "4.2.0-29344217.2658cf12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",