Reference:
https://github.com/gitname/react-gh-pages
https://github.com/yuenci/react-gh-pages
$ yarn add gh-pages
{
"name": "react_app",
"private": true,
"version": "0.0.0",
+ "homepage": "https://yuenci.github.io/react-gh-pages",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
+ "predeploy": "yarn build",
+ "deploy": "gh-pages -d build"
},
}
homepage: https://{gitname}.github.io/{projectName}
export default defineConfig({
plugins: [react()],
+ build: {
+ outDir: 'build'
+ },
+ base: './',
})
$ git init
$ git remote add origin https://github.com/yuenci/react-gh-pages
$ yarn deploy