-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (33 loc) · 923 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
var gulp = require("gulp");
var bsync = require("browser-sync");
var cprocess = require("child_process");
var reload = bsync.reload;
/* jekyll tasks */
gulp.task("jekyll-build", function(done) {
bsync.notify("Building Jekyll", 500);
return cprocess.spawn("jekyll", ["build"], { stdio: "inherit" })
.on("close", done);
});
/* browser sync tasks */
gulp.task("browser-sync", ["jekyll-build"], function() {
bsync.init({
server: { baseDir: "_site" },
ui: false
});
});
gulp.task("browser-reload", ["jekyll-build"], function() {
reload();
});
/* watch tasks */
gulp.task("watch-files", function() {
gulp.watch([
"index.html",
"_includes/*.html",
"_layouts/*.html",
"_posts/*",
"_sass/*.scss",
"assets/css/*.scss",
"assets/js/*.js"
], ["browser-reload"]);
});
gulp.task("default", ["browser-sync", "watch-files"]);