Node.js Grunt Config Helper Class to Help with Grunt configs and tasks.
![coverage][coverage]
![maintainability][maintainability]
Node.js Grunt Config Helper Class to Help with Grunt configs and tasks.
npm install --save-dev js.node.grunt.config.helper
Using the Extend functionality in a jit-grunt Environment like:
Project/
|build/
| |helper/
| |_grunt/
| |task_name/
| | |tasks1.js
| | |tasks2.js
| |task_name.js
|Gruntfile.js
Extend task_name.js
with task1.js
and task2.js
from task_name/
directory.task_name.js
filename must be the task name of the Grunt Plugin.
// task_name.js
module.exports = function() {
const path = require('path');
const GruntConfigHelper = require('js.node.grunt.config.helper');
const requireDirectory = path.resolve(__dirname, 'task_name');
const extendConfigHelper = new GruntConfigHelper(requireDirectory);
const tasks = extendConfigHelper.getTasks();
};
Using the Extend functionality in a standard Grunt Environment:
Project/
|build/
| |helper/
| |_grunt/
| |task1.js
| |task2.js
|Gruntfile.js
Extend Gruntfile.js
with task1.js
and task2.js
by filename.task1.js
and task2.js
filename must be the task name of the Grunt Plugin.
// Gruntfile.js
module.exports = function (grunt) {
const path = require('path');
const GruntConfigHelper = require('js.node.grunt.config.helper');
const requireDirectory = path.resolve(__dirname, 'build/helper/_grunt');
const extendConfigHelper = new GruntConfigHelper(requireDirectory, true);
const tasks = extendConfigHelper.getTasks();
// Project configuration.
grunt.initConfig({
tasks, // {task1: {...}, task2: {...}}
...
})
...
[coverage]:
https://api.codeclimate.com/v1/badges/017792a8149e03c3f71b/test_coverage
[maintainability]:
https://api.codeclimate.com/v1/badges/017792a8149e03c3f71b/maintainability