by alexlincoln

GitHub Readme.md

Heroku buildpack: Browserify + Stylus

How it Works

This buildpack is a fork of https://github.com/abecadel/heroku-buildpack-nodejs-grunt-bower substituting grunt and bower for browserify and stylus. Nib is also installed, if needed.


Create a new app with this buildpack:

heroku create myapp --buildpack https://github.com/alexlincoln/heroku-buildpack-nodejs-browseriy-stylus.git

Or add this buildpack to your current app:

heroku config:add BUILDPACK_URL=https://github.com/alexlincoln/heroku-buildpack-nodejs-browserify-stylus.git

Enable heroku user-env-compile lab:

heroku labs:enable user-env-compile

Set the NODE_ENV environment variable (e.g. development or production):

heroku config:set NODE_ENV=production

Update your build script in package.json to include your browserify/stylus build scripts, nib can be included as well

"scripts" : {
    "build" : "npm run build-js && npm run build-css"

Push to heroku

git push heroku master


npm can be run with a verbose flag to help debugging if something fails when installing the dependencies.

  • if the VERBOSE environment variable is set, npm is always run with verbose logging.
  • if BUILDPACK_RETRY_VERBOSE is set, npm is relaunched in verbose mode if npm failed.

Thanks to mackwic for these extensions.

Further Information

For more information about using Node.js and buildpacks on Heroku, see these Dev Center articles: