UNPKG

1.13 kBJavaScriptView Raw
1/**
2 * Created by Rodey on 2017/6/29.
3 */
4'use strict';
5
6const T = require('../tools'),
7 util = require('../utils');
8
9class TaskNodeFun {
10 /**
11 * 任务
12 * @param config 任务配置
13 * @param gupack Gupack对象
14 */
15 constructor(fun, gupack) {
16 this.name = undefined;
17 this.fun = fun;
18 this.src = '';
19 this.filters = '';
20 this.plugins = [];
21 this.watch = [];
22 this.run = true;
23 this.noWatch = false;
24 this.dest = null;
25 this.loader = {};
26 this.base = T.getArg('cwdir') || process.cwd();
27 this.gupack = undefined;
28 this.pluginCache = {};
29 this.merge = false;
30
31 if (gupack) {
32 this.gupack = gupack;
33 this.gulp = this.gupack.gulp;
34 this.basePath = this.gupack.basePath;
35 this.sourceDir = this.gupack.sourceDir;
36 this.buildDir = this.gupack.buildDir;
37 }
38
39 // this.init();
40 }
41
42 init() {
43 // util.isFunction(this.fun) && this.fun();
44 }
45}
46
47module.exports = TaskNodeFun;