-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (33 loc) · 912 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'),
browserSync = require('browser-sync'),
sass = require('gulp-sass'),
gutil = require('gulp-util'),
jade = require('gulp-jade');
var devDir = "builds/development/",
prodDir = "builds/production/";
gulp.task('jade', function(){
gulp.src(devDir + 'html/*.jade')
.pipe(jade())
.pipe(gulp.dest(prodDir));
});
gulp.task("sass", function(){
return gulp.src(devDir+'css/main.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(prodDir+'/css'));
});
gulp.task('js',function(){
gulp.src(devDir+'js/*.js')
.on('error', gutil.log)
.pipe(gulp.dest(prodDir+'/js'));
});
gulp.task("serve", function(){
browserSync.init({
server: {
baseDir: prodDir
}
});
});
gulp.task('watch', function(){
gulp.watch(devDir + "**/*.*", ['jade', 'js', 'sass', browserSync.reload]);
});
gulp.task('default', ['jade', 'sass', 'js', 'serve', 'watch']);