-
Notifications
You must be signed in to change notification settings - Fork 57
/
gulpfile.js
62 lines (62 loc) · 1.56 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
62
var gulp = require("gulp"),
rename = require("gulp-rename");
uglify = require("gulp-uglify");
babel = require("gulp-babel");
babili = require("gulp-babili");
rigger = require("gulp-rigger");
gulp.task("minify", function () {
gulp.src("src/*.js")
.pipe(babel({
presets: ["env"]
}))
.pipe(uglify())
.pipe(rename({basename: "display", suffix: ".min"}))
.pipe(gulp.dest("dist/light"));
});
gulp.task("copy", function () {
gulp.src("src/*.js")
.pipe(babel({
presets: ["env"]
}))
.pipe(rename({basename: "display"}))
.pipe(gulp.dest("dist/light"));
});
gulp.task("modern", function () {
gulp.src("src/*.js")
.pipe(rename({basename: "display", suffix: ".es6"}))
.pipe(gulp.dest("dist/light"));
});
gulp.task("modern-minify", function () {
gulp.src("src/*.js")
.pipe(babili({
mangle: {
keepClassName: true
}
}))
.pipe(rename({basename: "display", suffix: ".es6.min"}))
.pipe(gulp.dest("dist/light"));
});
gulp.task("modern-full", function () {
gulp.src("src/*.js")
.pipe(rigger())
.pipe(rename({basename: "display"}))
.pipe(gulp.dest("dist"));
});
gulp.task("modern-minify-full", function () {
gulp.src("src/*.js")
.pipe(rigger())
.pipe(babili({
mangle: {
keepClassName: true
}
}))
.pipe(rename({basename: "display", suffix: ".min"}))
.pipe(gulp.dest("dist"));
});
gulp.task("tests", function () {
gulp.src("src/*.js")
.pipe(rigger())
.pipe(rename({basename: "display"}))
.pipe(gulp.dest("__test__"));
});
gulp.task("default", [ "minify", "copy", "modern", "modern-minify", "modern-full", "modern-minify-full", "tests" ]);