I'll try to simplify this problem down:
I am deploying an application using Heroku, and I would like to automatically install my bower dependencies. When testing on a localhost, I would just run a "bower install" command in the terminal, but I am not sure how to translate this over to a deployed application.
You’ll need to install Bower as a dependency to your app in package.json.
npm install --save bower
You will then need to add a post install script in package.json with the path to your bower dependency inside node_modules, it should look like this
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install"
}
After the npm package is installed by Heroku, this script will be executed and your bower dependencies will be automatically installed!
I wrote a blog post about this not too long ago actually that goes into a little bit more detail: http://www.catherinebui.com/post/105338527207/deploying-node-js-app-on-heroku-with-bower#105338527207
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