A simply way to split grunt config for a better readability
Install the module with: npm install grrr --save-dev
'use strict';
module.exports = function (grunt) {
var grrr = require('grrr');
var copy = new grrr.Task('grunt-contrib-copy', 'copy');
var clean = new grrr.Task('grunt-contrib-clean', 'clean');
grrr.registerTask('default', [
clean.config('all', ['dest/']),
copy.config('html', {
src: 'src/*',
dest: 'dest/',
})
]);
grrr.run();
};
Create a new Task object
var copy = new grrr.Task('grunt-contrib-copy', 'copy');
Create a sub-configuration
copy.config('html', {
src: 'src/*',
dest: 'dest/',
}); // return "copy:html"
Register a new task
grrr.registerTask('copyhtml', ['copy:html']);
// or
grrr.registerTask('copyhtml', [
copy.config('html', {
src: 'src/*',
dest: 'dest/',
})
]);
Run grrr (actually configure and register tasks for grunt)
grrr.run()
(Coming soon)
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
- v0.0.1, TBD
- Big Bang
Copyright (c) 2014 Luc Momal. Licensed under the MIT license.