Для сайта проекта вы можете ввести любое имя. Для пользовательского сайта GitHub требует , чтобы имя репозитория имело следующий формат: {username}.github.io(например gitname.github.io)
npm uninstall @testing-library/jest-dom @testing-library/react @testing-library/user-event web-vitals
npm install gh-pages --save-dev / or -D
Добавьте homepageсвойство в этом формате*:https://{username}.github.io/{repo-name}
{
"name": "my-app",
"version": "0.1.0",
"homepage": "https://gitname.github.io/react-gh-pages",
"private": true,
"scripts": {
+ "predeploy": "npm run build",
+ "deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
- git init
- git add .
- git commit -m "first commit"
After t you need add
- git remote add origin https://github.com/{username}/{repo-name}.git
- git branch -M main
- git push -u origin main
- npm run deploy
- перейдем по ссылке которую указали в файле package.json
- "homepage": "https://gitname.github.io/react-gh-pages"