Prepare environments
ENV: node v16.20.1
In this project, I use pnpm. So that we need to install pnpm by:
npm install pnpm -g
Init project
Firstly, we need to create project by this command:
pnpm dlx create-turbo@lasted
Enter project name: "codeforstartup"
Start project
turbo dev
Add tailwindcss
Add tailwind-config package
Under packages folder, create tailwind-config folder.
Under tailwind-config folder create: File packages/tailwind-config/package.json
{
"name": "tailwind-config",
"version": "0.0.0",
"private": true,
"main": "index.js",
"devDependencies": {
"tailwindcss": "^3.2.4"
}
}
File packages/tailwind-config/tailwind.config.js
const colors = require("tailwindcss/colors");
module.exports = {
content: [
// app content
"./app/**/*.{js,ts,jsx,tsx}"
// include packages if not transpiling
// "../../packages/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
};
Nice. You added tailwind-config successfully. Now we need to install it by:
pnpm install