viteでgithub pagesにデプロイ
ちゃんと専用のdocがあってエラい
https://ja.vitejs.dev/guide/static-deploy.html#github-pages
上記にあるようにサブディレクトリ的なpathにデプロイする場合はbaseを設定する必要がある。
github actionsでデプロイしたので GITHUB_ACTIONS で切り分けた。
code:vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
base: process.env.GITHUB_ACTIONS ? "/ffcrop-web/" : "",
plugins: [
react(),
]
})