-
Notifications
You must be signed in to change notification settings - Fork 99
/
gulpfile.js
55 lines (49 loc) · 1018 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
const gulp = require("gulp");
const uglify = require("gulp-uglify-es").default;
let cleanCSS = require("gulp-clean-css");
const htmlmin = require("gulp-htmlmin");
const del = require("del");
gulp.task("clean", done => {
del.sync("build/**/*");
done();
});
gulp.task("minify-scripts", done => {
gulp
.src(["*.js", "!gulpfile.js"])
.pipe(uglify())
.pipe(gulp.dest("build"));
done();
});
gulp.task("minify-css", done => {
gulp
.src("*.css")
.pipe(cleanCSS())
.pipe(gulp.dest("build"));
done();
});
gulp.task("minify-html", done => {
gulp
.src("*.html")
.pipe(htmlmin({ collapseWhitespace: true }))
.pipe(gulp.dest("build"));
done();
});
gulp.task("copy", done => {
gulp
.src(["manifest.json", "images/**/*", "Roboto/**/*", "utils/**/*"], {
base: "."
})
.pipe(gulp.dest("build"));
done();
});
gulp.task(
"default",
gulp.series(
"clean",
"minify-scripts",
"minify-css",
"minify-html",
"copy",
done => done()
)
);