-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (33 loc) · 966 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 sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var minifyCss = require('gulp-clean-css');
var rename = require('gulp-rename');
var browserSync = require('browser-sync').create();
var livereload = require('gulp-livereload');
function style() {
return (
gulp
.src("./scss/*.scss")
// Use sass with the files found, and log any errors
.pipe(sass())
.on("error", sass.logError)
// What is the destination for the compiled file?
.pipe(gulp.dest("./src/css"))
.pipe(browserSync.stream())
);
}
function reload() {
browserSync.reload();
}
function watch(){
browserSync.init({
server: {
baseDir: "./src/"
}
});
gulp.watch('./scss/*.scss', style);
gulp.watch("./src/*.html", reload);
}
exports.watch = watch;