This buildpack uses the official Node.js buildpack refactoring called "diet" (faster compilation), and incorporate installation of compass and auto-execution of grunt.
The command that runs is
This is a Heroku buildpack for Node.js apps. It will detect your app as Node.js if it has a
package.json file in the root. It uses npm to install your dependencies, and vendors a version of the Node.js runtime into your slug.
If you don't specify a version of node, the latest stable version will be used.
This branch of the buildpack is intended to replace the official Node.js buildpack once it has been tested by some users. To use this buildpack for your node app, simply change your BUILDPACK_URL config var and push your app to heroku.
heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#diet -a my-node-app git commit -am "fakeout" --allow-empty git push heroku
Here's a summary of the differences between the current official buildpack and this diet fork version:
The old buildpack:
The new buildpack:
<0.6.3are no longer supported, and that the
engines.npmfield in package.json is now ignored.
node_modulesdirectory across builds.
npm pruneafter restoring cached modules, to ensure that any modules formerly used by your app aren't needlessly installed and/or compiled.
For more information about buildpacks and Node.js, see these Dev Center articles:
Grunt, grunt-cli, and bower are installed for you so they do not have to be included in project dependencies.
bower install is run to install bower dependencies.
This fork can take an additional config file which allows you to specify where to find the
package.json. The gruntfile (
Gruntfile.coffee) must be in the same directory. The config file should be
.heroku_config and located in the root of your project.
export NODE_WORKING_DIRECTORY='/console' export NPM_COMMAND='npm install'
NODE_WORKING_DIRECTORY- The location from the root of your project where you can find the
package.jsonand gruntfile (
Gruntfile.coffee). If it is not specified it will look in the root of your application. The string value is just appended to the value that is passed to the bin/compile and bin/detect scripts, so be sure to prefix it with a forward slash.
NPM_COMMAND- The command that should be run to setup your dependencies. It defaults to
npm install --productionif you do not specify anything. We
evalthis string, so procede with caution.
These commands are all executed from the directory you specify with
NODE_WORKING_DIRECTORY, and you can access the current location using
To make changes to this buildpack, fork it on Github. Push up changes to your fork, then create a new Heroku app to test it, or configure an existing app to use your buildpack:
# Create a new Heroku app that uses your buildpack heroku create --buildpack <your-github-url> # Configure an existing Heroku app to use your buildpack heroku config:set BUILDPACK_URL=<your-github-url> # You can also use a git branch! heroku config:set BUILDPACK_URL=<your-github-url>#your-branch
For more detailed information about testing buildpacks, see CONTRIBUTING.md
Copy the snippet above into CLI.