pnpx create vite@latest my-vite-app -- --template react
cd my-vite-app
pnpm install -D tailwindcss postcss autoprefixer
pnpx tailwindcss init -p
tailwind.config.js
/** @type {import('tailwindcss').Config} */
export default {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
postcss.config.js
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
index.css
index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
pnpm dev
pnpm build