Run only those tasks whose source files have changed.

Downloads in past


0.2.310 years ago10 years agoMinified + gzip package size for grunt-update in KB


NPM version Build Status Build Status
Run only those tasks whose source files are more recent than their destination targets.
This is like grunt-contrib-watch, but suitable for repeated invocation from the command line. It also doesn't get out of date if files changed while it wasn't running.

Getting Started

This plugin requires Grunt ~0.4.x
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-update --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

The "update" task


In your project's Gruntfile, add a section named update to the data object passed into grunt.initConfig().
  update: {
    tasks: ['task1', 'task2', 'task3']

Usage Examples

There are three formats you can use to configure this task.


update: { tasks: ['copy', 'jade', 'sass'] }

This configures an update task that acts as though defined by:
grunt.registerTask 'update', ['copy', 'jade', 'sass']

except that each of the copy, jade, and sass tasks will be executed only if their respective destination files either do not exist, or are out of date with respect to their source files.


update: {
  app: ['copy:app', 'jade:app', 'sass:app']
  libs: ['copy:libs', 'jade:libs', 'sass:libs']

This configures update:app and update:lib tasks. (update runs them both.)


update: {
    tasks: ['copy:app', 'jade:app', 'sass:app']
    tasks: ['copy:libs', 'jade:libs', 'sass:libs']

Like the Medium format, this configures update:app and update:lib tasks (and update runs them both.)


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.

Release History

  • September 24, 20012 -- initial release