gruntjs/grunt-next — pull request #1 by shama (2014-02-21 23:56:46+00:00)
Title: Start watch task implementation

Here is a start of the watch task implementation. I am testing using [gaze@0.6.0](https://github.com/shama/gaze/tree/v0.6) which will be released soon and has many performance updates.

This watch task has parity with the grunt-contrib-watch except for:

* Defaults to `spawn: false` instead of spawning (let everyone besides me rejoice)
* No livereload (Im thinking about whether this still belongs in watch, probably still yes)
* No `dateFormat` or proper date/time formatting
* Just accepts `cwd` and not the advanced `cwd: { spawn: filepath, tasks: filepath }` options
* No `watch` event emitted (I want to nix this as I think it is horrible)

The enhancements it has over the current watch task are:

* `changed` files are appended to the watch target's config. This lets users easily configure other tasks to operate on changed files `'<%= watch.target.changed %>`. And if mtime is integrated into grunt, it could handle file dependency trees or changed files based on SHAs in a generic way as well.
* Allows `tasks` to be set to a custom function. Which overrides the internal task runner if the user wants to add their own custom task runner (this is far superior to the watch event).

---

Currently as a separate task but could easily become a part of Grunt's core instead.