hosting
$ npm run build
They say you can upload it to AWS S3 and host it on CloudFront.
The explanation is about automation, but for now I'd like to do it manually once and then think about it.
Apparently, CloudFront is not necessary for HTTP.
Drag and drop upload to S3
I initially uploaded the build directory by itself.
The build created by npm run build references something like /static/foo.js, so if I open /build/index.html in a browser, loading JS from there fails
This is how it works.
code::
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
Place the contents of the build directory in the root of the bucket
→I got it.
---
This page is auto-translated from /nishio/ホスティング. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.