UNPKG

764 BJavaScriptView Raw
1/**
2 * 清空编译目录任务
3 * @author lukezhu
4 * @date 2016-03-24
5 */
6
7var combiner = require('stream-combiner2');
8var del = require('del');
9
10module.exports = function(gulp, $, conf) {
11 // 清除发布目录
12 gulp.task('clean:dist', function() {
13 return new Promise(function(resolve, reject) {
14 del(conf.parsePwd([conf.dist, '/**/*'].join('')), { force: true })
15 .then(resolve)
16 .catch(reject);
17 });
18 });
19
20 // 清除临时目录
21 gulp.task('clean:tmp', function() {
22 return new Promise(function(resolve, reject) {
23 del(conf.parsePwd([conf.tmp, '/**/*'].join('')), { force: true })
24 .then(resolve)
25 .catch(reject);
26 });
27 });
28}