-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
57 lines (48 loc) · 1.48 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
45
46
47
48
49
50
51
52
53
54
55
56
57
var gulp = require('gulp'),
browserSync = require('browser-sync'),
reload = browserSync.reload,
watch = require('gulp-watch'),
jade = require('gulp-jade'),
sass = require('gulp-ruby-sass'),
inject = require('gulp-inject'),
changed = require('gulp-changed');
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: './public'
}
});
});
gulp.task('images', function() {
return gulp.src('./assets/images/**/*')
.pipe(changed('./public/images'))
.pipe(gulp.dest('./public/images'));
});
gulp.task('copy:fonts', function() {
return gulp.src('./assets/fonts/*')
.pipe(gulp.dest('./public/css/fonts'));
});
gulp.task('jade', function(){
gulp.src('./views/*.jade')
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest('./public/'))
.pipe(reload({stream:true}));
});
gulp.task('sass', function () {
return sass('./scss/', {
style: 'compact'
}).on('error', function (err) {
console.error('Error!', err.message);
})
.pipe(gulp.dest('./public/css'))
.pipe(reload({stream:true}));
});
gulp.task('watch', function(){
gulp.watch('./views/*.jade', ['jade']);
gulp.watch('./scss/**/*.scss', ['sass']);
gulp.watch('./assets/images/**/*', ['images']);
gulp.watch('./assets/fonts/*', ['copy:fonts']);
});
gulp.task('default', ['jade', 'sass', 'images', 'copy:fonts', 'watch', 'browser-sync']);