Reputation: 762
I'm working with a create-react-app generated app which I'm deploying to Heroku. I would like to test out the production version npm run build
in an actual server.
Is it possible to serve the build version instead of the development version to heroku? It's okay if I can no longer have the dev version up in that heroku instance.
If possible, how can I do so, I have been searching up and nothing comes up
Upvotes: 1
Views: 525
Reputation: 28199
If you're following standard documentation on how to deploy react app to heroku, you're already running the production build on heroku.
That documentation uses create-react-app-buildback
for deployment and serving the app via Nginx. You can refer to this section that explains that the app is served from build directory
There is a way to verify this too. If you have react developer tools extension installed on your browser, it shows if the app is running production version or development version.
Upvotes: 1