React is a user interface library
Deploying a React project (with Vite and GitHub)
- cd new-project
- npm create vite@latest . — — template react
- npm install
- npm run dev
- (Write code in App.jsx)
git init, set origin
- git init
- git add .
- git commit -m ‘Initial commit’
- git remote add origin https://github.com/username/repo-name
- git remote -v
Install gh-pages, edit package.json / vite.config.js, edit GitHub repo settings
- npm install gh-pages —save-dev
- package.json: “predeploy”: “npm run build”, “deploy”: “gh-pages -d build”
- vite.config.js: base: “/repo-name”
- npm run build
- npm run deploy
- GitHub repo > Settings > Pages > Deploy from a branch (gh-pages)