-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (47 loc) · 1.23 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
51
52
53
54
var gulp = require("gulp");
var sass = require("gulp-sass");
var jade = require("gulp-jade");
var browserSync = require("browser-sync").create();
var autoprefixer = require("gulp-autoprefixer");
var sassPath = "sass";
var scssPath = "sass";
var cssPath = "css";
var jadePath = "jade";
gulp.task("jade", function() {
return gulp
.src(jadePath + "/*.jade")
.pipe(jade())
.on("error", console.error.bind(console))
.pipe(gulp.dest("."))
.pipe(browserSync.stream());
});
gulp.task("sass", function() {
return gulp
.src([sassPath + "/*.sass", scssPath + "/*.scss"])
.pipe(sass())
.on("error", console.error.bind(console))
.pipe(
autoprefixer({
browsers: ["last 2 versions"],
cascade: false
})
)
.on("error", console.error.bind(console))
.pipe(gulp.dest(cssPath))
.pipe(browserSync.stream());
});
gulp.task("browser-sync", function() {
browserSync.init({
server: {
baseDir: "."
}
});
});
gulp.task("watch", function() {
gulp.watch([sassPath + "/*.sass", scssPath + "/*.scss"], gulp.series("sass"));
gulp.watch(jadePath + "/*.jade", gulp.series("jade"));
});
gulp.task(
"default",
gulp.parallel(gulp.series("sass", "jade", "watch"), "browser-sync")
);