- install
gh-pagespackage from npm
npm install gh-pages --save-dev
- add these 2 scripts in
package.json
"predeploy": "npm run build",
"deploy": "gh-pages -d dist"
- add homepage in
package.jsonaftername
"homepage": "https://github.io/<github-username>/<github-repo-name>",
Note: replace the
<github-username>with your own GitHub username and the<github-repo-name>with your project's GitHub repository name
- add base in
vite.config.tsafterplugins
base: '/<github-repo-name>/'
Note: replace
<github-repo-name>with your project's GitHub repository name
- to deploy the web-app run the code in your terminal at projects location
npm run deploy