-
Notifications
You must be signed in to change notification settings - Fork 11
/
gulpfile.js
42 lines (41 loc) · 990 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
const gulp = require("gulp");
const rigger = require("gulp-rigger");
const rename = require("gulp-rename");
const babili = require("gulp-babel-minify");
const copy = () => {
return gulp
.src("src/*.js")
.pipe(rigger())
.pipe(rename({
basename: "glottologist"
}))
.pipe(gulp.dest("dist"));
};
const minify = () => {
return gulp
.src("src/*.js")
.pipe(rigger())
.pipe(babili({
mangle: {
keepClassName: true
}
}))
.pipe(rename({
basename: "glottologist",
suffix: ".min"
}))
.pipe(gulp.dest("dist"));
}
const test = () => {
return gulp
.src("src/*.js")
.pipe(rigger())
.pipe(rename({
basename: "glottologist"
}))
.pipe(gulp.dest("__test__"));
};
exports.copy = copy;
exports.minify = minify;
exports.test = test;
exports.default = gulp.parallel(copy, minify, test);