-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
36 lines (31 loc) · 871 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'),
sass = require('gulp-sass'),
cleanCSS = require('gulp-clean-css'),
rename = require('gulp-rename'),
connect = require('gulp-connect');
gulp.task('styles', function() {
gulp.src('scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css/'))
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('./css/'))
.pipe(gulp.dest('./docs/css/'))
.pipe(connect.reload());
});
gulp.task('html', function () {
gulp.src('index.html')
.pipe(connect.reload());
});
gulp.task('connect', function() {
connect.server({
root: '',
livereload: true
});
});
gulp.task('watch', function() {
gulp.watch('scss/**/*.scss', ['styles']);
gulp.watch('index.html', ['html']);
});
//Watch task
gulp.task('default', ['styles', 'connect', 'watch']);