This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
npm create vite@latest
To view commands, check file "package.json" in script section, you can run any script by nmp start "scriptname" i.e. nmp start dev
to add tailwind css in existing vite project (Go To for all frameworks, etc https://tailwindcss.com/docs/installation/framework-guides)
npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p
** @type {import('tailwindcss').Config} / export default { content: [ "./index.html", "./src/**/.{js,ts,jsx,tsx}", ], theme: { extend: {}, }, plugins: [], }
@tailwind base; @tailwind components; @tailwind utilities; // if you see warnings in vs code on above lines, it will work dont worry, to remove warnings //1- Go to the settings of vs code //2- Search for unknown, and change its setting to "ignore"
npm run dev