Advertisement
xerocool-101

002 Install React and Tailwindcss via Vite

Apr 20th, 2025 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.55 KB | Software | 0 0
  1. npm create vite@latest my-app -- --template react
  2. npm install
  3. npm run dev
  4.  
  5. npm install tailwindcss @tailwindcss/vite
  6.  
  7. vite.config.js/ts >>
  8. import { defineConfig } from "vite";
  9. import react from "@vitejs/plugin-react";
  10. import tailwindcss from "@tailwindcss/vite";
  11.  
  12. // https://vite.dev/config/
  13. export default defineConfig({
  14.   plugins: [react(), tailwindcss()],
  15. });
  16.  
  17.  
  18. App.css >>
  19. @import "tailwindcss";
  20. .custom {
  21. @apply border-b-2 border-gray-500 m-auto text-center py-4 text-gray-500;
  22. }
  23.  
  24. yarn create vite my-app --template react
  25. yarn
  26. yarn dev
Tags: JavaScript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement