A slightly modified version of Heroku's official Node.js buildpack with added Grunt support.
Shell
194
356 commits
updated Mar 10, 2016
Using Heroku's official Node.js buildpack with a postinstall script, that executes your Gruntfile is the suggested way on building Node.js with Grunt.
Supported Grunt versions: 0.3 and 0.4. See the Grunt migration guide if you are upgrading from 0.3.
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 (Gruntfile.js, Gruntfile.coffeeor grunt.js) 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.
Here's an overview of what this buildpack does:
* and >0.10.npm that comes bundled with node.node and npm on the PATH so they can be executed with heroku run.node_modules directory across builds for fast deploys.node_modules is checked into version control.npm rebuild if node_modules is checked into version control.npm install to ensure npm script hooks are executed.npm prune after restoring cached modules to ensure cleanup of unused dependencies.grunt if a Gruntfile (Gruntfile.js, Gruntfile.coffeeor grunt.js) is found.For more technical details, see the heavily-commented compile script.
Create a new app with this buildpack:
heroku create myapp --buildpack https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git
Or add this buildpack to your current app:
heroku buildpacks:set https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git
Set the NODE_ENV environment variable (e.g. development or production):
heroku config:set NODE_ENV=production
Create your Node.js app and add a Gruntfile named Gruntfile.js (or Gruntfile.coffee if you want to use CoffeeScript, or grunt.js if you are using Grunt 0.3) with a heroku task:
grunt.registerTask('heroku:development', 'clean less mincss');
or
grunt.registerTask('heroku:production', 'clean less mincss uglify');
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
npm can be run with a verbose flag to help debugging if something fails when installing the dependencies.
VERBOSE environment variable is set, npm is always run with verbose logging.BUILDPACK_RETRY_VERBOSE is set, npm is relaunched in verbose mode if npm failed.Thanks to mackwic for these extensions.
For more information about using Node.js and buildpacks on Heroku, see these Dev Center articles:
Shell
100.0%
A slightly modified version of Heroku's official Node.js buildpack with added Grunt support.
Shell
194
356 commits
updated Mar 10, 2016
Using Heroku's official Node.js buildpack with a postinstall script, that executes your Gruntfile is the suggested way on building Node.js with Grunt.
Supported Grunt versions: 0.3 and 0.4. See the Grunt migration guide if you are upgrading from 0.3.
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 (Gruntfile.js, Gruntfile.coffeeor grunt.js) 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.
Here's an overview of what this buildpack does:
* and >0.10.npm that comes bundled with node.node and npm on the PATH so they can be executed with heroku run.node_modules directory across builds for fast deploys.node_modules is checked into version control.npm rebuild if node_modules is checked into version control.npm install to ensure npm script hooks are executed.npm prune after restoring cached modules to ensure cleanup of unused dependencies.grunt if a Gruntfile (Gruntfile.js, Gruntfile.coffeeor grunt.js) is found.For more technical details, see the heavily-commented compile script.
Create a new app with this buildpack:
heroku create myapp --buildpack https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git
Or add this buildpack to your current app:
heroku buildpacks:set https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git
Set the NODE_ENV environment variable (e.g. development or production):
heroku config:set NODE_ENV=production
Create your Node.js app and add a Gruntfile named Gruntfile.js (or Gruntfile.coffee if you want to use CoffeeScript, or grunt.js if you are using Grunt 0.3) with a heroku task:
grunt.registerTask('heroku:development', 'clean less mincss');
or
grunt.registerTask('heroku:production', 'clean less mincss uglify');
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
npm can be run with a verbose flag to help debugging if something fails when installing the dependencies.
VERBOSE environment variable is set, npm is always run with verbose logging.BUILDPACK_RETRY_VERBOSE is set, npm is relaunched in verbose mode if npm failed.Thanks to mackwic for these extensions.
For more information about using Node.js and buildpacks on Heroku, see these Dev Center articles:
Shell
100.0%