"I’ve been using Vite with React/Vue and am now migrating to Nuxt. My architecture is typically feature-driven; for example, I have a views/ directory containing an auth/ folder. Inside that folder, I co-locate everything related to that feature: pages, hooks, composables, components, utils, i18n, etc. Global items stay in the src/ root.
I know in Next.js I can use the _directory prefix to prevent folders from becoming routes, but I’m struggling to replicate this in Nuxt. Manually defining routes in nuxt.config.ts breaks definePageMeta and feels like I'm fighting the framework. Nuxt Layers also don't feel like the right fit for this (Good for DDD but weird for my use case, one reason is because priority things...). My only idea is to keep 'thin' files in the pages/ directory that simply import the actual view from my feature folder.
What do you suggest? Is there a better way to implement a modular, feature-driven structure in Nuxt without losing built-in features?"
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community