-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (30 loc) · 955 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');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
/*******************************
Main build tasks
*******************************/
gulp.task('watch', ['serve', 'watch:sass', 'watch:html', 'watch:js']);
/*******************************
Development build tasks
*******************************/
gulp.task('serve', ['sass-watch'], function() {
browserSync.init({
server: "./client"
});
});
gulp.task('watch:sass', function () {
gulp.watch("client/assets/sass/*.scss", ['sass-watch']);
});
gulp.task('watch:html', function () {
gulp.watch("client/**/*.html").on('change', browserSync.reload);
});
gulp.task('watch:js', function () {
gulp.watch("client/**/*.js").on('change', browserSync.reload);
});
gulp.task('sass-watch', function() {
return gulp.src("client/assets/sass/**/*.scss")
.pipe(sass())
.pipe(gulp.dest("./client/assets/css"))
.pipe(browserSync.stream());
});