-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
34 lines (30 loc) · 795 Bytes
/
Copy pathgulpfile.js
File metadata and controls
34 lines (30 loc) · 795 Bytes
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
var gulp = require("gulp"),
sass = require("gulp-sass"),
autoprefixer = require("gulp-autoprefixer"),
plumber = require("gulp-plumber"),
browserSync = require("browser-sync");
gulp.task("sass", function() {
return gulp
.src("./scss/**/style.scss")
.pipe(plumber())
.pipe(sass.sync())
.pipe(
autoprefixer({
browsers: ["last 3 version", "IE 11"]
})
)
.pipe(gulp.dest("./css"))
.pipe(browserSync.stream());
});
gulp.task("watch", function() {
gulp.watch("./scss/**/*.scss", ["sass"]);
gulp.watch(["./index.html", "./js/*.js"]).on("change", browserSync.reload);
});
gulp.task("browser-sync", function() {
browserSync.init({
server: {
baseDir: "./"
}
});
});
gulp.task("default", ["sass", "browser-sync", "watch"]);