cowboy/grunt — Issue #46: Watch task - potentially useful feature request
Author: zonak
Created: 2012-02-16 18:47:29+00:00
State: open

I wanted to bring up a watch task scenario that might by useful and not that uncommon.

Currently the watch task allows us to monitor a file, a group of files or a folder for changes for certain type of files and upon change fire a task that is already defined. This is great but I think there is space and a need for improvement.

Lets say we want to use the watch task for things like CoffeScript, Less, Stylus compiling instead of using their own watch features for the purpose of centralizing our tasks and also fill in for the absence of a watch feature like in the case of Less.

At this point when a task is initiated upon a file change we can only run an existing task without really knowing which file has changed. If the name of the file that has changed can be passed to a task that knows how to handle it would be very beneficial.

I'll try to explain with an example:

Lets say we are watching a folder for changes in CoffeScript files. If one file changes, we don't necessarily want to re-compile all the files but just the one that has changed.

Given that currently there is no way for tasks to communicate with one another, enabling such mechanism may even lead to some other useful stuff.

Ultimately I'd like to use grunt for everything that it is or potentially might be able to handle and avoid the need of using other build / minify / compile tools.