Grunt-organized enables you to write more organized Gruntfiles. It enhances the Grunt API to allow organizing your Gruntfile by target rather than by task. It also makes your Gruntfile more DRY by offering a clean, simple way to register a group of tasks under an alias.
##Example Gruntfile.js
Here is a sample Gruntfile.js using grunt-organized.
Grunt-organized takes care of merging multiple targets into a single grunt-contrib-copy configuration and calls grunt.registerTask to create the alias tasks.
Grunt-organized also lets you mix custom task functions, target configurations, and task names in a single call to registerTask:
/* * Register a task called 'cleanup' that will use grunt-contrib-clean, then * run the 'stop-server' task, and finally run a custom task. */ grunt.registerTask('cleanup', [ { clean: { src: ['temp/**/*'] } }, 'stop-server', function(grunt) { console.log('All done!'); } ]);
##Usage
npm install --save-dev grunt-organized
In your Gruntfile, load and invoke the module, passing it your grunt object and optionally a grunt configuration
object. This will return an object that mimics the grunt API such that it's a drop-in replacement for grunt.
It will also call grunt.initConfig.