Working with Multiple Nuxt Projects in a Monorepo
Hi everyone 
I'm building a monorepo that contains multiple Nuxt applications, and I'm looking for best practices around structure, shared code, and how to configure the build system efficiently.
Here's my current directory structure:
javascript/
βββ app1/
β βββ pages/
β βββ layouts/
β βββ components/
βββ app2/
β βββ pages/
β βββ layouts/
β βββ components/
βββ shared/
βββ components/
βββ composables/
βββ utils/
Each app1 and app2 is a standalone Nuxt 3 application with its own pages, layouts, and components. The shared/ folder contains reusable code that should be accessible by both apps β things like global components, composables, and utility functions.
What Iβm trying to achieve:
Clearly separate app1 and app2 as independent Nuxt frontends (e.g., for different clients or parts of a platform)
Import shared code (components, composables, utils) from a central place without duplication
Use Vite (default in Nuxt 3) to efficiently handle dev/build for multiple apps
Avoid code duplication while keeping developer experience smooth
Questions
What's the best way to structure a Nuxt monorepo with multiple apps and shared code?
How can I configure Vite (inside Nuxt) to:
Support multiple Nuxt app entry points?
Share code from a shared/ directory across apps?
Should shared/ be a local package (e.g., using npm link, pnpm workspace, or a custom alias)?
Is it better to use pnpm workspaces, Yarn workspaces, or a monorepo tool like Nx or TurboRepo with Nuxt?
I'm building a monorepo that contains multiple Nuxt applications, and I'm looking for best practices around structure, shared code, and how to configure the build system efficiently.
Here's my current directory structure:
javascript/
βββ app1/
β βββ pages/
β βββ layouts/
β βββ components/
βββ app2/
β βββ pages/
β βββ layouts/
β βββ components/
βββ shared/
βββ components/
βββ composables/
βββ utils/
Each app1 and app2 is a standalone Nuxt 3 application with its own pages, layouts, and components. The shared/ folder contains reusable code that should be accessible by both apps β things like global components, composables, and utility functions.
Clearly separate app1 and app2 as independent Nuxt frontends (e.g., for different clients or parts of a platform)
Import shared code (components, composables, utils) from a central place without duplication
Use Vite (default in Nuxt 3) to efficiently handle dev/build for multiple apps
Avoid code duplication while keeping developer experience smooth
What's the best way to structure a Nuxt monorepo with multiple apps and shared code?
How can I configure Vite (inside Nuxt) to:
Support multiple Nuxt app entry points?
Share code from a shared/ directory across apps?
Should shared/ be a local package (e.g., using npm link, pnpm workspace, or a custom alias)?
Is it better to use pnpm workspaces, Yarn workspaces, or a monorepo tool like Nx or TurboRepo with Nuxt?
