I have a compiled folder named /target where my server.js lives. Since it's compiled files, I added /target to .gitignore since I don't want all those changes checked it into my GitHub.
But Heroku ignores anything listed in the .gitignore, so I'm unable to spin up the app.
Ideally I'd like to run node /target/scripts/server.js in Heroku. And not have the compiled /target folder checked into GitHub.
What's the best way to handle this situation?
Seems like none answered this question, hope this will help someone :)
Step 1: create a seperate branch for heroku that contains your target folder, say myheroku.
git checkout -b myheroku
Step 2: modify .gitignore by removing target/, run your command lein cljsbuild to generate production files.
git add target/
git commit -m "your commit message"
Step3: push the branch with target changes to heroku
git push heroku myheroku:master
So, after working & finished testing,
heroku local branch; can generate build files NOTE: i hope there is no problem for you dealing with that extra commit messages polluting heroku localbranch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With