i was confused about the fact that how is production build deployed ? suppose i have a MERN app now i have access to an aws instance and in there i just go like yarn run dev
to start react-vite
app at PORT 3000
and express API hosted at the same instance, when the client land at site he goes to 3000 port(react app). so point is what's the use of production build here and how does it work ? i run yarn build and get a /dist folder that's it. i did look it up and some article said this /dist is used for static deployment, got me confused isn't react app CSR.
i have bootstraped the React project with vite and using expressjs API and have access to aws instance. it doesnt have to be AWS instance i just wanna know how to use this production build. i know what's the difference between production build and dev but dont know how this production build comes into play when app is depoloyed, is it auto taken care of by the service provider e.g. AWS or i do some settings etc. any help would be appreciated.
I haven't played with Vite yet but all modern JS apps have an entry point file, which is index.html that imports all needed JS files the application requires to initialize. All those files are created when the build
to production command has run.
With those files you can deploy to AWS, it can be a simple S3 for the static files or an EC2 that points to this index.html
when the user hits its URL.