refill
v1.2.2
Published
Loader for reusable gulp tasks
Downloads
3
Readme
Refill
Loader for reusable gulp tasks
Shields
Installation
npm install --save refill gulp
Example
Refill is used as a base for Refill for Angular
API
require('refill')(tasksDefinitions, gulp, ...);
gulp
Gulp instance, usually require('gulp')
.
tasksDefinitions
Defining tasks
{
taskName: {
task: {
getTask: function(
options, // this object contains options computed from options passed to refill and task default options
gulp, // instance of gulp passed to refill
...) // extra arguments passed to refill
{
return function() { // this function is actual gulp task function, which will be passed to gulp with given dependencies
}
},
defaultOptions: {
option1: 'defaultValue',
option3: 'totally different value'
}
},
dependencies: ['task2', 'task3'], // defaults to []
enabled: true, // defaults to true
option1: 'value',
option2: 'other value'
}
}
For every task options are merged only 1 level deep. Deeper they will be overwritten.
For example if you have default options
{
defaultOptions: {
option1: 1
option2: 2
option3: {
subOption1: 3
subOption2: 4
}
}
}
and you pass to refill
{
someTask: {
option1: 11
option3: {
subOption1: 5
}
}
}
actual options object in task is
{
someTask: {
option1: 11
option2: 2
option3: {
subOption1: 5
}
}
}