-
Notifications
You must be signed in to change notification settings - Fork 16
/
gulpfile.js
50 lines (41 loc) · 1.1 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
47
48
49
50
var gulp = require('gulp'),
clean = require('gulp-clean'),
connect = require('gulp-connect'),
jade = require('gulp-jade'),
sass = require('gulp-sass');
var outputDir = ".";
gulp.task("clean", function() {
return gulp.src([outputDir + "/*.html", outputDir + "/*.css"])
.pipe(clean());
});
gulp.task("jade", function() {
return gulp.src("src/jade/*.jade")
.pipe(jade({pretty: true}))
.pipe(gulp.dest(outputDir))
.pipe(connect.reload());
});
gulp.task("reload", function() {
return connect.reload();
});
gulp.task('connect', function() {
connect.server({
root: [__dirname + "/.."],
port: 3000,
livereload: true
});
});
gulp.task("watch", function() {
gulp.watch("src/jade/*.jade", ["jade"]);
gulp.watch("*.css", ["reload"]);
gulp.watch("src/sass/*.scss", ["sass"]);
});
gulp.task("sass", function() {
return gulp.src('src/sass/**/*.scss')
.pipe(sass({
style: 'compact'
}))
.pipe(gulp.dest(outputDir))
.pipe(connect.reload());
});
gulp.task("default", ["jade", "sass", "watch", "connect"]);
gulp.task("build", ["jade", "sass"]);