-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (30 loc) · 874 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
var fs = require("fs"),
gulp = require("gulp"),
clean = require("gulp-clean"),
sequence = require("run-sequence"),
sourcemaps = require("gulp-sourcemaps"),
swig = require('gulp-swig'),
webserver = require("gulp-webserver");
var htmlsrc = ['views/**/*.html','!views/includes/**','!views/layouts/**'];
gulp.task("watch", function () {
gulp.watch(['views/**/*.html'], [ "templates" ]);
});
gulp.task("templates", function(){
gulp.src(htmlsrc)
.pipe(swig())
.pipe(gulp.dest('./'));
});
gulp.task("webserver", function() {
gulp.src('./')
.pipe(webserver({
port: 8080,
livereload: true,
open: true
}));
});
gulp.task("default", function (cb) {
sequence("templates", "watch", "webserver", cb);
});
gulp.task("build", function (cb) {
sequence("templates", cb);
});