- install
gh-pages
package 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.json
aftername
"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.ts
afterplugins
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