next 12, react 18를 설치
yarn create-next-app@latest --typescript
npm i next@latest react@rc react-dom@rc
yarn add -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
yarn add -D prettier prettier-plugin-tailwindcss
-p
를 통해서 postCSS를 적용한다.tailwind.config.js
module.exports = {
content: ["./pages/**/*.tsx", "./components/**/*.tsx"],
theme: {
extend: {},
},
plugins: [],
};
postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
globals.css
@tailwind base;
@tailwind components;
@tailwind utilities;