Next.js Discord

Discord Forum

Sharing pages across repos

Unanswered
Akbash posted this in #help-forum
Open in Discord
AkbashOP
I am starting a new project for work based on nextjs for a large ecommerce website hosted in AWS that will be maintained by multiple teams with different repos and release cadences.

Based on existing team structures and release cadences, I would like to have separate repos for different parts of the site based on root path, and also have a shared repo for things like the root layout and shared components like site header and footer.

Is there a way to reuse routing parts like pages/layouts using app router across npm module boundaries, so things like middleware and root layouts can be managed as npm dependencies?

An example of reuse would be a root layout that injects the site header and theme information so that each sub directory wouldn't be inserting the site's header and top level CSS, site skeleton, etc.

1 Reply

AkbashOP
The https://vercel.com/templates/next.js/microfrontends seems like the best reference to use but the code has not been updated in a while. Is it still the recommended approach given the rest of the context in my post?