Run grunt tasks with only those source files staged for code commit.
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-staged --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-staged');
The staged task doesn't require any special configuration. To use it, just add staged
as the first argument when running other tasks.
This command is heavily based on grunt-newer, except it determines which files should be handled based on git staging.
This task is best used when you want to make sure a set of discrete changes is processed, but do not want to include other changes in your operations.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2015 Adam "Grayside" Ross. Licensed under the MIT license.