-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
39 lines (29 loc) · 1 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var _ = require('lodash');
var yargs = require('yargs');
var gutil = require('gulp-util');
var normalizeConfig = require('./lib/util/normalizeConfig.js');
var requireGulp = require('./lib/util/requireGulp.js');
var createTask = require('./lib/task.js');
var createComposition = require('./lib/composition.js');
function createInstance(config) {
config = normalizeConfig(config)
var instance = createTask(config);
instance.task = instance;
instance.series = createComposition(config, instance, 'series');
instance.parallel = createComposition(config, instance, 'parallel');
instance.withGulp = function(gulp) {
return createInstance(_.assign({}, config, {gulp: gulp}));
};
instance.withOptions = function(options) {
return createInstance(_.assign({}, config, options));
};
return instance;
}
module.exports = createInstance({
gulp: requireGulp,
argv: yargs.argv,
log: gutil.log,
paramsName: ['params', 'parameters'],
callbackName: ['done', 'cb', 'callback'],
_require: null
});