| name | Monorepo with Turborepo | ||
|---|---|---|---|
| slug | monorepo-turborepo | ||
| description | Learn to implement a monorepo with a single Next.js site that has installed two local packages. | ||
| framework | Next.js | ||
| useCase | Documentation | ||
| css | Tailwind | ||
| deployUrl | https://vercel.com/new/clone?repository-url=https://github.com/vercel/examples/tree/main/solutions/monorepo&project-name=monorepo&repository-name=monorepo&root-directory=apps/app&install-command=pnpm%20install&build-command=cd%20..%2F..%20%26%26%20pnpm%20build%20--filter%3Dapp...&ignore-command=npx%20turbo-ignore | ||
| demoUrl | https://solutions-monorepo.vercel.sh | ||
| relatedTemplates |
|
This is a monorepo example with a single Next.js site (./apps/app) that has installed two local packages:
- ./packages/ui: Exports UI components that use TypeScript and Tailwind CSS and is compiled by SWC.
- ./packages/utils: Exports utility functions that use TypeScript.
The monorepo is using Turborepo and pnpm workspaces to link packages together.
For more examples on monorepos check out the official Turborepo examples.
https://solutions-monorepo.vercel.sh
You can choose from one of the following two methods to use this repository:
Deploy the example using Vercel:
Execute create-next-app with pnpm to bootstrap the example:
pnpm create next-app --example https://github.com/vercel/examples/tree/main/solutions/monorepo monorepoNext, run app in development mode:
pnpm devThe app should be up and running at http://localhost:3000.
Deploy it to the cloud with Vercel (Documentation).