-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
39 lines (34 loc) · 954 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 browserSync = require('browser-sync');
var reload = browserSync.reload;
gulp.task('styles', function() {
gulp.src('sass/**/*.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('./css/'))
.pipe(reload({stream:true}));
});
// reload server
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: "./"
}
});
});
// Reload all Browsers
gulp.task('bs-reload', function () {
browserSync.reload();
});
//Watch task
gulp.task('watch',function() {
gulp.watch('sass/**/*.scss',['styles']);
gulp.watch("*.html", ['bs-reload']);
});
// deploys
gulp.task('default', ['styles','browser-sync','watch']);