NuxtN
Nuxt14mo ago
4 replies
Dante

[Solved] Implementing Layers In Existing Project

I have an existing Nuxt project and I am trying to understand how I implement Layers in it. This is my nuxt.config

export default defineNuxtConfig({
  devtools: { enabled: true },
  compatibilityDate: "2024-04-03",
  future: {
    compatibilityVersion: 4,
  },

  srcDir: "src/",
  modules: ["@nuxt/ui"],
});


My folder structure is
.
├── ...
├── server/
├── src/
│   ├── components
│   ├── layouts
│   ├── pages/
│   │   └── ...
│   └── app.vue
├── package.json
└── nuxt.config.js



From my understanding, a nuxt layer is a folder right (with a nuxt config), that you use to extend parts of your project? With that definition I could make a folder in an existing project and that would become a layer? Say auth in this picture? And the overall layers folder would go in my src?


Adendum: Is there any convention on how your organise said layeres
layears.png
Was this page helpful?