概要
root以外のhtmlを見に行ってしまうと、
react-router-domによるルーティングでコンポーネントを出すことができないので、
以下のように必ずindex.htmlを見つけられる設定が必要。
vercel
vercel.json
{
"rewrites": [
{ "source": "/(.*)", "destination": "/" }
]
}
netlify
public/_redirects
/* /index.html 200
root以外のhtmlを見に行ってしまうと、
react-router-domによるルーティングでコンポーネントを出すことができないので、
以下のように必ずindex.htmlを見つけられる設定が必要。
vercel.json
{
"rewrites": [
{ "source": "/(.*)", "destination": "/" }
]
}
public/_redirects
/* /index.html 200