-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (41 loc) · 955 Bytes
/
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
/*jshint esnext: false, globalstrict: true */
"use strict";
var gulp = require("gulp");
var babel = require("gulp-babel");
var del = require("del");
// `gulp build`
// ------------
gulp.task("build", ["clean", "scripts"]);
// `gulp scripts`
// --------------
var scripts =
{ source: "source/**/*.js"
, es6Target: "dist.es6"
, es5Target: "dist.es5"
};
gulp.task("scripts", ["scripts:es6", "scripts:es5"]);
gulp.task("scripts:es6"
, ["scripts:clean"]
, function () {
return gulp.src(scripts.source)
.pipe(gulp.dest(scripts.es6Target))
;
}
);
gulp.task("scripts:es5"
, ["scripts:clean"]
, function () {
return gulp.src(scripts.source)
.pipe(babel())
.pipe(gulp.dest(scripts.es5Target))
;
}
);
gulp.task("scripts:clean", function (done) {
del([scripts.es6Target, scripts.es5Target]
, done
);
});
// `gulp clean`
// ------------
gulp.task("clean", ["scripts:clean"]);