-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
61 lines (37 loc) · 1.26 KB
/
gulpfile.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* Created by samuel on 2016/9/4.
*/
(function(){
'use strict';
const gulp = require('gulp');
const babel = require('gulp-babel');
const sourcemaps = require('gulp-sourcemaps');
const changed = require('gulp-changed');
const del = require('del');
var watch = require('gulp-watch');
var debug = require('gulp-debug');
var browserSync = require('browser-sync').create();
gulp.task('clean', function (cb) {
del([
'bin/**',
// 'dist/report.csv',
// // 这里我们使用一个通配模式来匹配 `mobile` 文件夹中的所有东西
// 'dist/mobile/**/*',
// // 我们不希望删掉这个文件,所以我们取反这个匹配模式
// '!dist/mobile/deploy.json'
], cb);
});
gulp.task('build',() => {
return gulp.src('lib/**/*.js')
.pipe(debug({title:'git-server:'}))
.pipe(changed('bin'))
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('bin'));
});
gulp.task('watch',function () {
return gulp.watch('lib/**/*.js',['build']);
});
gulp.task('default',['clean','build','watch']);
})();