Rashid Shamloo
Posted on March 4, 2023
Just follow these simple steps:
1. Install the gh-pages
package (ctrl+~
to open the terminal in VS Code)
npm install gh-pages --save-dev
2. In the package.json
file add these lines before "build": "vite build",
"predeploy": "npm run build",
"deploy": "gh-pages -d dist",
3. In the vite.config.js
file add this line before plugins: [react()],
base: "/YOUR_REPOSITORY_NAME",
Change YOUR_REPOSITORY_NAME
to the name of your GitHub repository.
4. In terminal type
npm run deploy
š You now have a gh-pages
branch in your repository and your app is deployed (you can check it under Settings -> Pages
)
P.S. To update your app deployment, just run the npm run deploy
command again.
š šŖ š
š©
Rashid Shamloo
Posted on March 4, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.