Closed stouch closed 2 months ago
I don't really understand this deployment, I'm glad it worked. If you have any further questions, please let me know.
I had to do this because your lib build the static files as : /my-page.html (instead of /my-page/index.html), and so to tell cloudfront to redirect /my-page to /my-page.html , the above code was necessary.
Oh, this configuration item may help you: https://vite-react-ssg.netlify.app/docs/Configuration#dirstyle
I setup my S3 with : index.html as index and error file.
Then I setup my Cloudfront distribution with a Origin Request Lambda@Edge function (node20) like this :
And everything worked then.
Thanks for your repo. Actually, it's insane that building a static site is not more obvious/straightforward when we're using react + vite project. Happily you made this repo 🔥 (I created a thread in react.dev about this last part : https://github.com/reactjs/react.dev/issues/7155)