Skip to content

Instantly share code, notes, and snippets.

@kaustavray21
Created January 25, 2025 12:42
Show Gist options
  • Save kaustavray21/6389e91408cff58d7a86f4d11913c619 to your computer and use it in GitHub Desktop.
Save kaustavray21/6389e91408cff58d7a86f4d11913c619 to your computer and use it in GitHub Desktop.
  1. install gh-pages package from npm
npm install gh-pages --save-dev
  1. add these 2 scripts in package.json
"predeploy": "npm run build",
"deploy": "gh-pages -d dist"
  1. add homepage in package.json after name
"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

  1. add base in vite.config.ts after plugins
  base: '/<github-repo-name>/'

Note: replace <github-repo-name> with your project's GitHub repository name

  1. to deploy the web-app run the code in your terminal at projects location
npm run deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment