Search code examples
reactjsheroku

react app is running development mode on Heroku?


how should my scripts look like if I want to deploy to Heroku ? and make sure the app is running in production mode (build), so basically I push my current code to github and deploy that pushed code from Heroku the problem is my app is running in dev mode and it totally ignores building the app for some reason any idea how to fix this issue?

"scripts": {
  "start": "react-scripts start",
  "build": "react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject"
},

I also want my application to run in the EU region, but the mars/create-react-app buildpack sets my app location to USA.


Solution

  • You can still use mars/create-react-app. Common runtime apps always default to the US region, no matter which buildpack you are using.

    Use the --region argument when creating your app:

    heroku create YOUR_APP_NAME --region eu
    

    Then you can use mars/create-react-app as usual. If you want to set the buildpack at the time of app creation you can include the --buildpack flag:

    heroku create YOUR_APP_NAME --region eu --buildpack mars/create-react-app