I recently switched to Gulp for several projects, and I'm thinking of switching back to Grunt.
Gulp lacks of some important features. For instance, it does not allow to sequentially execute tasks: everything is done in parallel. This could for sure be emulated by using async, but the overhead is not worth it.
On the other side, Grunt does support sequential and parallel tasks execution, but is more verbose and does a lot of file writing on the disk (though it is relatively moderate).
One concrete example for sequential tasks execution (easily done with Grunt):
- Watch JavaScript files, when a modifications is detected:
- lint files -> [JSHint, JSCS]
- if success: launch tests -> [Karma, Mocha]
- if success: notify
- If any failure occurs: notify and abort the sequenceThere's a package[1] for Gulp which does exactly that.
But that's great if you are going to do it. This may make me come around and give a second chance to Gulp.
This is false. You can set perquisites for a task, which will be executed in sequence.
However, task dependencies allows sequential tasks execution, but that's not very handy as you may want a same task to be executed in two different sequences.
Let's see a simple example on which I honestly struggle to reproduce with Gulp:
[Lint, Test] -> Concatenation -> Minification
Watch -> [Lint, Test] -> LiveReload
How would you do such a setup without having a redundancy in your tasks declaration?[1]: https://github.com/gulpjs/gulp/blob/master/docs/recipes/runn...
For instance, I wrote a custom tag to modify specific pages to inject javascript include statements in HTML pages. There is probably a plugin for that, but I was able to write the code in 15 minutes so I didn't care.