0

I made an application using create-react-app, set up TravisCI, and deployed to Heroku. The application deploys (the server is running, I've shelled in and saw files), but the /build folder isn't present.

According to this answer, this is because I've listed /build in my .gitignore file and I can fix the problem by removing that entry; however, the Heroku dev center recommends against keeping generated files in version control.

Is there a way to mark my /build folder as required in production? Am I thinking about this the correct way?

aebabis
  • 3,657
  • 3
  • 22
  • 40

1 Answers1

2

Is ok to have your /build folder added to your .gitignore file. When the deployments happens, Heroku will install the app (npm install). Make sure that you have the engines (node and npm versions) specified in your package.json. Also, if you need more flexibility you can use the scripts hooks for npm install (preinstall and postinstall).

You can find all this steps in Heroku documentation: Getting Started on Heroku with Node.js

Gabi
  • 589
  • 3
  • 9