I mean this as a sincere statement and not to be snarky, but I still can't figure out why people use Grunt over Makefiles.
Reasons people have stated:
1. It's cross platform compatible. But so are Makefiles, you can download just 'Make' for Windows.
2. It has plugins. What's wrong with text streams and individual programs? i.e. Grunt has a 'Less' css processor plugin. But that's really easy to do with Make and the Less program.
Grunt files seem overly verbose, whereas *most* makefiles seem simply readable. What else am I missing? Why do you use Grunt?
I work on an Enterprise grade application that uses makefiles extensively. We recently rolled Grunt into the loop for the development process because of grunt-watch. If you have many js files and you're working on the front-end, your process goes something like this:
1- Type code and save
2- Alt tab to the cygwyn / terminal
3- [up > enter] to send "make" again
4- Wait for n seconds, where n scales based on your code size (really long wait times)
5- alt tab to browser and test
6- repeat.
Grunt-watch can automatically detect modified files in folders and run operations on them. Process then becomes:
1- type code and save
2- alt tab to browser and test
You might be thinking this process is just as slow because no part of what I've described solves the long compile process. The secret to it is that make simply does a bulk operation, whereas with a watcher knows which file was modified. We have the compressed version of each file individually resting in another folder and only update newly modified files into that folder. Whenever update happens, all we need to do is concat the prebuilt files with the new file and that process only takes milliseconds.
Hi JP,
To be honest I really hated Grunt when I first tried it for similar reasons. However, having used it for some time now I can definitely say it has improved my productivity and the quality of my applications.
It all comes down to picking tools that you are most comfortable with and Grunt is one of the many options.