-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gulpfile.js
33 lines (26 loc) · 878 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
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
gulp.task('styles', function() {
gulp.src('sass/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css/'))
});
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./"
});
gulp.watch("scss/*.scss", ['sass']);
gulp.watch('sass/**/*.scss',['styles']);
gulp.watch("*.html").on('change', browserSync.reload);
gulp.watch("css/*.css").on('change', browserSync.reload);
});
// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
return gulp.src("scss/*.scss")
.pipe(sass())
.pipe(gulp.dest("css"))
.pipe(browserSync.stream());
});
gulp.task('default', ['serve']);