2

In the past, I've only uploaded my front end applications as static versions using github's GH-Pages. This is my first React app and it connects to a backend API that I have uploaded and running on Heroku.

I used Create-React-App to build this app in react. When I command npm run build... Webpack builds out my es5 version of the code so that it can be read by the browser. So my question is, being this is my first time uploading a front end application on heroku, how do I do this with my react files?

Thanks

1 Answer 1

4

There is a buildpack that will allow you to deploy to heroku with no configuration necessary! See Mars Hall's blog post on the subject at https://blog.heroku.com/deploying-react-with-zero-configuration

On the blog you'll find the instructions for deploying a new create-react-app to heroku, but to do it for a pre-existing project...

cd to your project folder in the terminal and enter the following

git init 

heroku create YOURPROJECTNAME --buildpack https:/github.com/mars/create-react-app-buildpack.git 
// (creates the heroku project with the create-react-app buildpack specified)

git add . 

git commit -m "YOUR COMMENTS" 

git push heroku master 

heroku open
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.