Inlining grunt tasks
Grunt config files can easily become very verbose and disparate with related tasks scattered far apart. Without careful organisation and maintenance they can become quite unwieldy. In this post I’ll discuss some of the ways I’ve been experimenting with to make gruntfiles terser and keep related components together. I’ll introduce the grunt-inline-task-sugar plugin which I created to implement some of the ideas discussed.
Anatomy of the alias task The grunt ‘alias’ task type is probably familiar to you:
Adding a directed task graph to grunt
Last year we migrated our build system for a multi platform cordova app to Grunt from ant. It was great. Well, actually it was just quite good. See, whilst I’m really not a fan of ant, the ant task graph is nice. It upsets me that I can’t express branching task dependencies in Grunt.
####The problem
In this case we wanted to do a bunch of common setup once then do n platform specific steps for n platforms.