This project was created with a tool named Vite. The React code is exactly like the code that you learned how to write. The only difference is that your files will have the extension of .jsx instead of .js.
- Clone this repository.
cd
to the project directory.- Run
npm install
- Run
npm run dev
You should see output in your terminal like this.
VITE v4.4.9 ready in 3531 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
Open the URL that you see in your browser.
To use Vite+Tailwind in any future project, here are the steps you can follow.
mkdir rock-client && cd rock-client
npm create vite@latest . -- --template react
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
- Replace the contents of
tailwind.config.js
with the following./** @type {import('tailwindcss').Config} */ export default { content: [ "./index.html", "./src/**/*.{js,ts,jsx,tsx}", ], theme: { extend: {}, }, plugins: [], }
- Replace the contents of
index.css
@tailwind base; @tailwind components; @tailwind utilities;
- Run with
npm run dev