-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (29 loc) · 839 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
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var runSequence = require('run-sequence');
var sass = require('gulp-sass');
var useref= require('gulp-useref');
var uglify= require('gulp-uglify');
var gulpIf= require('gulp-if');
var gulpCache= require('gulp-cache');
//static server
gulp.task('browser-sync',function(){
browserSync.init({
server: {
baseDir: ['./','./src']
}
});
});
gulp.task('reload',function(){
return gulp.src('./src/css/style.scss')
.pipe(sass().on('error',sass.logError))
.pipe(gulp.dest('./src/css'))
.pipe(browserSync.reload({stream:true}));
});
gulp.task('watch',function(){
gulp.watch('./src/css/**/*.scss',['reload']);
});
gulp.task('default', function(cb){
//code here
runSequence(['browser-sync','watch'],cb);
});