-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (39 loc) · 1.05 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
var del = require("del");
var gulp = require("gulp");
var ghPages = require("gulp-gh-pages");
var nodemon = require("gulp-nodemon");
var processMaps = require("./process-maps.js");
var SRC_PATH = "./src/";
var DIST_PATH = "./dist/";
gulp.task("deploy", ["build"], function () {
return gulp.src(DIST_PATH + "**/*").pipe(ghPages());
});
gulp.task("build", ["maps"], function () {
var filesToCopy = [
"css/*",
"images/*",
"index.html",
"js/**/*",
"sounds/*"
];
return gulp.src(filesToCopy, { cwd: SRC_PATH + "/**" }).pipe(gulp.dest(DIST_PATH));
});
gulp.task("clean", function () {
return del(DIST_PATH);
});
gulp.task("server", ["build"], function () {
return nodemon({
script: "server.js",
ext: "js html css",
watch: [SRC_PATH],
ignore: ["src/maps", DIST_PATH],
tasks: ["build"]
}).on("restart", function () {
console.log("restarted!");
});
});
gulp.task("maps", ["clean"], function () {
gulp.src("maps/map*.txt", { cwd: SRC_PATH })
.pipe(processMaps())
.pipe(gulp.dest(DIST_PATH + "map/load/"));
});