-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
44 lines (39 loc) · 1.07 KB
/
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
42
43
44
var del = require('del');
var gulp = require('gulp');
var sass = require('gulp-sass');
var gulpIf = require('gulp-if');
var cache = require('gulp-cache');
var coffee = require('gulp-coffee');
var cssnano = require('gulp-cssnano');
// var imagemin = require('gulp-imagemin');
var browserSync = require('browser-sync').create();
gulp.task('default', ['watch']);
gulp.task('sass', function() {
console.log('compiling SASS files...');
return gulp.src('app/scss/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('coffee', function() {
return gulp.src('app/coffee/**/*.coffee')
.pipe(coffee())
.pipe(gulp.dest('app/js'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('browserSync', function() {
browserSync.init({
server: {
baseDir: 'app'
},
});
});
gulp.task('watch', ['browserSync', 'sass', 'coffee'], function (){
gulp.watch('app/scss/**/*.scss', ['sass']);
gulp.watch('app/coffee/**/*.coffee', ['coffee']);
gulp.watch('app/*.html', browserSync.reload);
});