Skip to content

Adding Astro to a Monorepo

This presumes that the monorepo is already set up using ‘pnpm’. And that it exists to styles and other utilities.

In the root directory of the monorepo:

pnpm create astro@latest apps/new-app-name

Say yes to installing Typescript and dependencies.

Change the name in package.json to the new-app-name

Say No to initializing Git. If this happens automatically:

rm -rf apps/your-site-name/.git

Add Tailwind in using the theme components.

pnpm --filter your-site-name astro add tailwind

Follow instructions for setting that up in your site. (Include these in the monorepo’s theme package README because this changes often.)

In the root directory, install it all

pnpm install

Push it all to git.

git add apps/new-app-name
git commit -m "Add new-site-name to monorepo"`