Giter VIP home page Giter VIP logo

heroku-buildpack-nodejs-grunt-bower's Introduction

Heroku buildpack: Node.js

How it Works

Here's an overview of what this buildpack does:

  • Uses the semver.io webservice to find the latest version of node that satisfies the engines.node semver range in your package.json.
  • Allows any recent version of node to be used, including pre-release versions.
  • Uses an S3 caching proxy of nodejs.org for faster downloads of the node binary.
  • Discourages use of dangerous semver ranges like * and >0.10.
  • Uses the version of npm that comes bundled with node.
  • Puts node and npm on the PATH so they can be executed with heroku run.
  • Caches the node_modules directory across builds for fast deploys.
  • Doesn't use the cache if node_modules is checked into version control.
  • Runs npm rebuild if node_modules is checked into version control.
  • Always runs npm install (with devDependencies) to ensure npm script hooks are executed.
  • Always runs npm prune after restoring cached modules to ensure cleanup of unused dependencies.

For more technical details, see the heavily-commented compile script.

Usage

Create a new app with this buildpack:

heroku create myapp --buildpack https://github.com/abecadel/heroku-buildpack-nodejs-grunt-bower.git

Or add this buildpack to your current app:

heroku config:add BUILDPACK_URL=https://github.com/abecadel/heroku-buildpack-nodejs-grunt-bower.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

Push to heroku

git push heroku master
...
-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.8.2
       Using npm version: 1.1.41
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       ...
       Dependencies installed
-----> Building runtime environment
-----> Found gruntfile, running grunt heroku task
Running "heroku" task
...
-----> Discovering process types

Debugging

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:

heroku-buildpack-nodejs-grunt-bower's People

Contributors

abecadel avatar alanverbner avatar bripkens avatar btubbs avatar cleishm avatar davidjrice avatar ddollar avatar dzuelke avatar ekryski avatar flyerhzm avatar hone avatar jacobwgillespie avatar jclem avatar lackac avatar mbuchetics avatar mmcgrana avatar ryanbrainard avatar rykov avatar timshadel avatar zbuc avatar zeke avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.