Before we begin, make sure you have the following installed:
Ctrl + Shift + P
(or Cmd + Shift + P
on macOS)Preferences: Open Settings (JSON)
→ select itPaste the following into your settings.json
file:
{"git.ignoreMissingGitWarning": true,"[javascript]": {"editor.defaultFormatter": "vscode.typescript-language-features"},"[typescriptreact]": {"editor.defaultFormatter": "vscode.typescript-language-features"},"explorer.confirmDelete": false,"[javascriptreact]": {"editor.defaultFormatter": "esbenp.prettier-vscode"},"files.autoSave": "afterDelay","[html]": {"editor.defaultFormatter": "esbenp.prettier-vscode"},"editor.formatOnSave": true,"editor.tabCompletion": "on","editor.formatOnPaste": true,"eslint.format.enable": true,"editor.renderWhitespace": "all","editor.stickyTabStops": true,"vs-code-prettier-eslint.prettierLast": true,"prettier.tabWidth": 4,"prettier.useTabs": true,"[mdx]": {"editor.defaultFormatter": "unifiedjs.vscode-mdx"},"explorer.confirmPasteNative": false,"files.associations": {".env*": "dotenv"},"editor.tokenColorCustomizations": {"[*Light*]": {"textMateRules": [{"scope": "ref.matchtext","settings": {"foreground": "#000"}}]},"[*Dark*]": {"textMateRules": [{"scope": "ref.matchtext","settings": {"foreground": "#fff"}}]},"textMateRules": []},"dotenv.enableAutocloaking": false,"terminal.integrated.enableMultiLinePasteWarning": "never","html.format.enable": false,"github.copilot.nextEditSuggestions.enabled": false,"github.copilot.enable": {"*": true,"plaintext": false,"markdown": false,"scminput": false,"typescriptreact": true},"github.copilot.advanced": {}}
Ctrl + Shift + X
)Vite is a modern frontend build tool created by Evan You (the creator of Vue.js). It’s designed to provide a faster and more efficient development experience compared to older tools like Webpack.
Open your terminal and run the following command to scaffold a new Vite + React project:
npm create vite@latest my-react-app -- --template react
Replace
my-react-app
with your desired project name.
After the project is scaffolded:
cd my-react-appnpm install
To start the dev server:
npm run dev
You’ll see something like this:
VITE vX.X.X ready in XXX ms➜ Local: http://localhost:5173/
Open that URL in your browser to see your new React app in action!
Install the necessary packages:
npm install tailwindcss @tailwindcss/vite
vite.config.ts
Update your vite.config.ts
(or .js
) to include the Tailwind plugin:
// vite.config.tsimport { defineConfig } from 'vite'import tailwindcss from '@tailwindcss/vite'export default defineConfig({plugins: [tailwindcss()],})
Create a CSS file like src/style.css
and import Tailwind:
/* src/style.css */@import "tailwindcss";
Make sure the CSS file is included in your HTML (this depends on your framework). For example, in plain HTML:
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><link href="/src/style.css" rel="stylesheet" /></head><body><h1 class="text-3xl font-bold underline">Hello world!</h1></body></html>
In React/Vue/etc., simply import the CSS in your main.tsx
or main.js
:
import './style.css'
Go to https://github.com.
Click “New repository” (usually on the top left or under your profile dropdown).
Fill in:
vite-react-app
)Click “Create repository”
Make sure you’re inside your Vite project folder:
git initgit remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
git add .git commit -m "Initial Vite project setup"git push -u origin main
If you get an error saying “main does not exist”, you might need:
git branch -M maingit push -u origin main
Quick Links
Legal Stuff
Social Media