var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./app"
});
gulp.watch("app/scss/*.scss", ['sass']);
gulp.watch("app/*.html").on('change', browserSync.reload);
});
// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
return gulp.src("app/scss/*.scss")
.pipe(sass())
.pipe(gulp.dest("app/css"))
.pipe(browserSync.stream());
});
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: 'dev/client'
},
notify: false
});
});
gulp.task('watch', ['browser-sync',], function() {
gulp.watch('app/js/*.js', browserSync.reload);
});
gulp.task('default', ['serve', 'watch'])