-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (33 loc) · 1.1 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
var gulp = require('gulp'),
browserSync = require('browser-sync'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
notify = require('gulp-notify');
gulp.task('testing', function () {
console.log('Gulp OK!');
});
gulp.task('serve',['sass'], function () {
notify('BrowserSync started!').write('');
browserSync.init({
server: "./app"
});
gulp.watch('app/sass/*.scss', ['sass']);
gulp.watch('app/*.html').on('change', browserSync.reload);
});
gulp.task('sass', function() {
return gulp.src('app/sass/*.scss')
.pipe(sass({errLogToConsole: false, outputStyle: 'compressed'}))
.on('error', function(err) {
notify().write(err);
this.emit('end');
})
.pipe(autoprefixer({
browsers: ['last 2 versions', 'IE 10']
}))
.pipe(gulp.dest('app/css'))
.pipe(browserSync.stream())
});
gulp.task('watch', function() {
gulp.watch('app/sass/*scss', ['sass']);
});
gulp.task('default', ['serve', 'watch']);