Reputation: 420
i have a MERN stack application that i wish to deploy to heroku, in my package.json file i have the "build" command in scripts, whenever i try to deploy heroku runs the build command automatically and fails, which fails everything else..i already use build on my local machine before deploying so i don't want the script to be run again.. i checked around and found this article in herokus dev logs
https://devcenter.heroku.com/changelog-items/1573
it says if i wish to stop that from happening i need to "specify a heroku-postbuild script in package.json file."
what is this postbuild script? how can i do that? can someone give me an example please?
Upvotes: 0
Views: 841
Reputation: 6298
Not familiar with Heroku but this link provides an explanation on why you might need to build again on a deploy to Heroku and also gives a sample build script.
If you're sure you don't have to do any build on Heroku and just uploading (deploying) your files is enough, then your heroku-postbuild
could just display (log) a message. The example on Heroku's website for heroku-postbuild
simply displays (logs) a message.
Upvotes: 1