forked from n-zeplo/ui-dev-workshop-exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 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
40
41
var gulp = require('gulp'),
sass = require('gulp-sass'),
connect = require('gulp-connect'),
path = require('path'),
plumber = require('gulp-plumber');
var sassFiles = ['**/*.scss', '!node_modules/**/*.*', '!reset.scss'];
var cssFiles = ['**/*.css', '!node_modules/**/*.*'];
var htmlFiles = ['**/*.html', '!node_modules/**/*.*'];
gulp.task('sass', function() {
gulp.src(sassFiles)
.pipe(plumber())
.pipe(sass())
.pipe(gulp.dest('./'));
});
gulp.task('connect', function() {
connect.server({
root: path.resolve('./'),
livereload: true
});
});
gulp.task('css', function () {
gulp.src(cssFiles)
.pipe(connect.reload());
});
gulp.task('html', function () {
gulp.src(htmlFiles)
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(sassFiles, ['sass']);
gulp.watch(cssFiles, ['css']);
gulp.watch(htmlFiles, ['html']);
});
gulp.task('default', ['connect', 'sass', 'watch']);