This is an example setup for a mono repository using Tailwind CSS version 4.
First install the necessary dependencies
pnpm install
Update all dependencies in all apps and packages to latest version
pnpm up --recursive --latest
Then you can run the project with
pnpm dev
or you can build an optimized production version with
pnpm build
or build and run the production version with
pnpm start
This Turborepo includes the following packages/apps:
web
: a Next.js app with Tailwind CSSdesign-system
: a collection of basic React Design System components and Design Tokens styled with Tailwind CSS and shared with web
application and other packages.ui
: a set of more specific React UI components with Tailwind CSS shared with web
application.@turbo-with-tailwind/eslint-config
: eslint
configurations (includes eslint-config-next
and eslint-config-prettier
)@turbo-with-tailwind/typescript-config
: tsconfig.json
s used throughout the monorepoEach package/app is 100% TypeScript.
This example is set up to produce compiled styles for design-system
and ui
components into the dist
directories. The component .tsx
files are consumed by the Next.js apps directly using transpilePackages
in next.config.js
. This was chosen for several reasons:
tailwindcss
.Compared to Tailwind CSS version 3 the tailwind config files have been removed (including the shared config package). All configurations are now placed directly inside the CSS file(s) see Tailwind Upgrade Guide for more information. As well as Tailwind's directives for custom configurations.
This Turborepo has some additional tools already setup for you: