Personal portfolio website to host some of my side-projects and advertise my freelancer work.
- Install the
gh-pages
package
npm install gh-pages --save-dev
- In the
package.json
file, add the following line to thescripts
section
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d dist",
"dev": "vite",
"build": "vite build",
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
- In the
package.json
file, add the following line to thehomepage
section, where<github_acocunt>
is the name of the github account and<repo_name>
is the name of the repository
"homepage": "https://<github_acocunt>.github.io/<repo_name>/",
- In the
vite.config.js
file, add the following line to thebase
section, where<repo_name>
is the name of the repository
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "/<repo_name>/"
})
- Go back to terminal and run
npm run deploy
Now, you have deployed this website and you could check it under your repo's Settings -> Pages
..