Last active
May 13, 2025 06:07
-
-
Save mdasifmunshe/2e675ea92d625adf445dc1a7d369eed9 to your computer and use it in GitHub Desktop.
Setting up Tailwind CSS in a Vite app with Yarn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The following gist is tested with react+typescript+swc. | |
Other Framework may differ from each other at "vite.config.ts" file. | |
*/ | |
/* Terminal */ | |
yarn create vite my-app | |
cd my-app | |
yarn add -D tailwindcss @tailwindcss/vite | |
/* vite.config.ts */ | |
import { defineConfig } from 'vite' | |
import react from "@vitejs/plugin-react-swc"; | |
import tailwindcss from '@tailwindcss/vite' | |
// https://vite.dev/config/ | |
export default defineConfig({ | |
plugins: [ | |
react(), | |
tailwindcss() | |
], | |
}) | |
/* src/index.css */ | |
@import "tailwindcss"; | |
/* Terminal */ | |
yarn dev | |
/* Happy Coding */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment