forked from monkeytypegame/monkeytype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (38 loc) · 1.18 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
const { task, src, dest, series, watch } = require("gulp");
const concat = require("gulp-concat");
const del = require("del");
const vinylPaths = require("vinyl-paths");
var sass = require("gulp-sass");
sass.compiler = require("dart-sass");
//the order of files is important
const gulpSrc = [
"./src/js/misc.js",
"./src/js/words.js",
"./src/js/layouts.js",
"./src/js/db.js",
"./src/js/userconfig.js",
"./src/js/commandline.js",
"./src/js/leaderboards.js",
"./src/js/settings.js",
"./src/js/account.js",
"./src/js/script.js",
];
task("cat", function () {
return src(gulpSrc).pipe(concat("monkeytype.js")).pipe(dest("./dist/js"));
});
task("sass", function () {
return src("./src/sass/*.scss")
.pipe(sass({ outputStyle: "compressed" }).on("error", sass.logError))
.pipe(dest("dist/css"));
});
task("static", function () {
return src("./static/**/*").pipe(dest("./dist/"));
});
task("clean", function () {
return src("./dist/", { allowEmpty: true }).pipe(vinylPaths(del));
});
task("compile", series("static", "sass", "cat"));
task("watch", function () {
watch(["./static/**/*", "./src/**/*"], series("compile"));
});
task("build", series("clean", "compile"));