I'd like to decouple certain parts of my app into their own modules and go for a monorepo approach, while still making use of nuxt's file tree structure for pages and layouts.
For example:
```app/
โโ client/
โ โโ pages/
โ โโ layouts/
โ โโ (other nuxt folders...)
โ โโ nuxt.config.js
โโ packages/
โโ nuxt-module-admin-dashboard/
โโ pages/
โ โโ dashboard/
โ โโ index.vue // { name: 'dashboard', path: '/dashboard', ... }
โโ module.js
โโ server-middleware.js
โโ package.json
### Describe the solution you'd like
Support for multiple `pages`/`layouts`-directories (could be extended to other dirs too, `assets`, `static`, etc).
Examples:
#### Module
```js
export default function () {
this.addPages(path.resolve(__dirname, 'pages'))
}
dir: {
pages: [ // array support
'./pages',
'../packages/nuxt-module-admin-dashboard/pages',
'../packages/*/pages' // glob support?
]
}
Related issues: https://github.com/nuxt/nuxt.js/issues/2522, https://github.com/nuxt/nuxt.js/issues/7879 and https://github.com/nuxt-community/modules/issues/148
Thoughts or ideas?
WIP #8188
@duurland you can use create-routes temporarily.
Multi app will be natively supported with nuxt3. Please see https://github.com/nuxt/rfcs/issues/30 for context.
Most helpful comment
WIP #8188