개발/Javascript

Vite + React + tailwind CSS

ebkim 2024. 12. 3. 01:24

Vite + React + Typescript 설정

npm create vite@latest

 

 

 

tailwind CSS 설치

npm install tailwindcss

 

postcss, autoprefixer 설치

npm install -D postcss autoprefixer

 

postcss.config.js 및 tailwind.config.js 생성

npx tailwindcss init -p

 

tailwind.config.js 작성

/** @type {import('tailwindcss').Config} */
export default {
  content: ["./src/**/*.{js,jsx,ts,tsx}"],
  theme: {
    extend: {},
  },
  plugins: [],
}

 

 

index.css 작성

@tailwind base;
@tailwind components;
@tailwind utilities;