GitHub Readme.md
heroku create --buildpack=https://github.com/robgraeber/heroku-buildpack-nodejs-bower-gulp.git
. To be safe, you should fork this and use your fork's URL.gulp build
.
heroku config:set GULP_TASK=build
(Or any other name).bower.json
/.bowerrc
file that will be used with bower install
. Packages not in bower.json
are pruned each build.Procfile
: e.g. web: node server.js
.npm start
script.server.js
file.app.js
file.Note: It will only use bower/gulp if bower.json
or gulpfile.js
is found. Otherwise it's usable the same as other Node.js buildpacks, except with extra entry points.
When the buildpack runs it will do many things similarly to the standard Heroku buildpack. In addition it will do the following things, in roughly this order.
bower.json
is found
directory
key from .bowerrc
if that is presentnpm install bower
to install bower locallybower install
to install bower_components
. bower_components
or whichever alternate directory was specified in .bowerrc
gulpfile.js
is found
npm install gulp
to install gulp locally during the buildgulp build
to build the appProcfile
is not found
npm start
scriptserver.js
fileapp.js
fileThe bower component caching is very similar to the node_modules caching done for npm. The cache is restored before each build and bower prune
is run to remove anything no longer needed before doing the bower install
. This is the same way the standard buildpack handles caching.
Bonus: Also installs the latest npm + 'nasm' which is a dependency for imageMin.
I also like to create some useful aliases that help me deploy in 1-line. (Add the following to your .bash_profile):
heroku-push() {
git push heroku master $1 $2 $3
heroku open
}
heroku-delete() {
heroku apps:destroy -a $1 --confirm $1
}
heroku-auto-create() {
heroku create $1 $2 $3 --buildpack=https://github.com/robgraeber/heroku-buildpack-nodejs-bower-gulp.git
heroku-push
}
alias heroku-create='heroku create --stack cedar-14 --buildpack=https://github.com/robgraeber/heroku-buildpack-nodejs-bower-gulp.git'
alias heroku-portal='open https://dashboard.heroku.com/apps'
alias heroku-set='heroku config:set'
alias heroku-rebuild='heroku repo:rebuild'
alias heroku-logs='heroku logs --tail'
Example: Type "heroku-auto-create myAppNameHere" to auto deploy in 1 line.
Forked from heroku-buildpack-nodejs-gulp.
Which was forked from heroku-buildpack-nodejs.
Heavily based on heroku-buildpack-nodejs-grunt.
Copy the snippet above into CLI.