GitHub Readme.md
Set your Heroku app's buildpack URL to https://github.com/appstack/heroku-buildpack-nodejs-gulp.git
. To be safe, you should really fork this and use your fork's URL.
Run heroku config:set NODE_ENV=production
to set your environment to production
(or any other name)
Add a Gulp task called heroku:<NODE_ENV>
that builds your app. For instance, if you followed the line above and set NODE_ENV to production, the name of this task would be heroku:production
Add a single line Procfile
to the root to serve your app via node. This example assumes that you have a web.js
file in the root of your project:
web: node web.js
When the buildpack runs it will do many things similarly to the standard Heroku buildpack. In addition it will do the following things, not exactly in this order.
gulpfile.js
is found
npm update gulp
to install gulp locally during the buildgulp heroku:${NODE_ENV}
to build the appbower.json
is found
directory
key from .bowerrc
if that is presentnpm update bower
to install bower locallybower install
to install bower_components
.bower_components
or whichever alternate directory was specified in .bowerrc
The 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.
Inspired by Deploying a Yeoman/Angular app to Heroku.
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.