Giter Club home page Giter Club logo

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

Heroku buildpack: Node.js with grunt support

This is a fork of Heroku's official Node.js buildpack with added grunt support. Using this buildpack you do not need to commit the results of your grunt tasks (e.g. minification and concatination of files), keeping your repository clean.

After all the default Node.js and NPM build tasks have finished, the buildpack checks if a gruntfile (grunt.js, Gruntfile.js, Gruntfile.coffee) exists and executes the heroku task by running grunt heroku. For details about grunt and how to define tasks, check out the offical documentation. You must add grunt to the NPM dependencies in your package.json file. If no gruntfile exists, the buildpacks simply skips the grunt step and executes like the standard Node.js buildpack.

Usage

Create a new app with this buildpack:

heroku create myapp --buildpack https://github.com/1lobby/heroku-buildpack-nodejs-grunt.git

Or add this buildpack to your current app:

heroku config:add BUILDPACK_URL=https://github.com/1lobby/heroku-buildpack-nodejs-grunt.git

Create your Node.js app and add a gruntfile named grunt.js (also works with Gruntfile.js or Gruntfile.coffee) with a heroku task:

grunt.registerTask('heroku', 'clean less mincss');

Don't forget to add grunt to your dependencies in package.json. If your grunt tasks depend on other pre-defined tasks make sure to add these dependencies as well:

"dependencies": {
    ...
    "grunt": "*",
    "grunt-contrib": "*",
    "less": "*"
}

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

Further Information

Heroku: Buildpacks

Heroku: Getting Started with Node.js

Buildpacks: Heroku for Everything

Grunt: a task-based command line build tool for JavaScript projects

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

Contributors

cleishm avatar ddollar avatar hone avatar jcurtis avatar jmreidy avatar lackac avatar mbuchetics avatar mmcgrana avatar timshadel avatar zbuc 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.