-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (46 loc) · 1.19 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
var gulp = require('gulp'),
concat = require('gulp-concat'),
sass = require('gulp-sass'),
nodemon = require('gulp-nodemon'),
browserSync = require('browser-sync'),
bourbon = require('node-bourbon').includePaths,
neat = require('node-neat').includePaths,
refills = require('node-refills').includePaths;
gulp.task('sass',function(){
gulp.src('public/sass/main.scss')
.pipe(sass({
includePaths:['sass'].concat(bourbon).concat(neat).concat(refills),
errLogToConsole:true
}))
.pipe(gulp.dest('public/css'));
});
gulp.task('nodemon',function(cb){
var called = false;
return nodemon({
script: 'app.js',
watch: ['app.js','public/**/*.*']
})
.on('start',function onStart(){
if(!called){cb();}
called = true;
})
.on('restart',function onRestart(){
setTimeout(function reload(){
browserSync.reload({
stream:false
});
},500);
});
});
gulp.task('browser-sync',['nodemon'],function(){
browserSync.init({
files:['public/**/*.*'],
proxy:'http://localhost:8000',
port:4000,
browser:['google chrome']
});
});
gulp.task('watch',function(){
gulp.watch('public/sass/main.scss',['sass']);
});
gulp.task('default',['watch','browser-sync']);