Skip to content

Monorepo with Turborepo

Learn to implement a monorepo with a single Next.js site that has installed two local packages.

Framework Next.js
Use Case Documentation
CSS Tailwind
Publisher ▲ Vercel

Monorepo

This is a monorepo example with a single Next.js site (./apps/app) that has installed two local packages:

The monorepo is using Turborepo and pnpm workspaces to link packages together, but it can also work with yarn workspaces or npm workspaces.

For more examples on monorepos check out the official Turborepo examples.

In addition to the local packages, it's also using a external package called @vercel/examples-ui that's inside this same repository, it uses next-transpile-modules to transpile its UI components that use CSS Modules.

Demo

https://solutions-monorepo.vercel.sh

How to Use

You can choose from one of the following two methods to use this repository:

One-Click Deploy

Deploy the example using Vercel:

Getting Started

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example https://github.com/vercel/examples/tree/main/solutions/monorepo monorepo
# or
yarn create next-app --example https://github.com/vercel/examples/tree/main/solutions/monorepo monorepo

Next, run app in development mode:

pnpm
pnpm dev

# or

yarn
yarn dev

# or

npm install
npm run dev

The app should be up and running at http://localhost:3000.

Deploy it to the cloud with Vercel (Documentation).

Monorepo with Turborepo

Learn to implement a monorepo with a single Next.js site that has installed two local packages.

Framework Next.js
Use Case Documentation
CSS Tailwind
Publisher ▲ Vercel

Monorepo

This is a monorepo example with a single Next.js site (./apps/app) that has installed two local packages:

The monorepo is using Turborepo and pnpm workspaces to link packages together, but it can also work with yarn workspaces or npm workspaces.

For more examples on monorepos check out the official Turborepo examples.

In addition to the local packages, it's also using a external package called @vercel/examples-ui that's inside this same repository, it uses next-transpile-modules to transpile its UI components that use CSS Modules.

Demo

https://solutions-monorepo.vercel.sh

How to Use

You can choose from one of the following two methods to use this repository:

One-Click Deploy

Deploy the example using Vercel:

Getting Started

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example https://github.com/vercel/examples/tree/main/solutions/monorepo monorepo
# or
yarn create next-app --example https://github.com/vercel/examples/tree/main/solutions/monorepo monorepo

Next, run app in development mode:

pnpm
pnpm dev

# or

yarn
yarn dev

# or

npm install
npm run dev

The app should be up and running at http://localhost:3000.

Deploy it to the cloud with Vercel (Documentation).

Unleash New Possibilities

Deploy your app on Vercel and unlock its full potential