After publishing my react app, I noticed the page was blank, after going to the network tab on inspect, I realized Github pages was requesting:
/assets/index-1acd6362.js
instead of:
/project-name/assets/index-1acd6362.js
My package.json already has the correct url on the homepage field.
homepage
in package.json
is for create-react-app
For vite you need to set base
in vite config to your github repo name
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: '/react-league-champs/'
})