-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
84 lines (73 loc) · 1.88 KB
/
gulpfile.js
File metadata and controls
84 lines (73 loc) · 1.88 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
var gulp = require('gulp'),
coffee = require('gulp-coffee'),
cjsx = require('gulp-cjsx'),
gutil = require('gulp-util'),
jade = require('gulp-jade'),
sass = require('gulp-ruby-sass'),
stylus = require('gulp-stylus'),
connect = require('gulp-connect'),
bowerFiles = require('main-bower-files');
var coffeeSrc = ['./src/**/*.coffee'],
cjsxSrc = ['./src/**/*.cjsx'],
jadeSrc = ['./src/**/*.jade'],
sassSrc = ['.src/**/*.scss', '.src/**/*.sass'],
stylusSrc = ['./src/**/*.styl'],
htmlSrc = ['./dest/**/*.*'];
gulp.task('coffee', function () {
gulp.src(coffeeSrc)
.pipe(coffee({
bare: true
}))
.on('error', gutil.log)
.pipe(gulp.dest('./dest/js/'));
});
gulp.task('cjsx', function () {
gulp.src(cjsxSrc)
.pipe(cjsx({
bare: true
})
.on('error', gutil.log))
.pipe(gulp.dest('./dest/js/'));
});
gulp.task('jade', function () {
var locals = {};
gulp.src(jadeSrc)
.pipe(jade({
locals: locals
}))
.pipe(gulp.dest('./dest/'));
});
// gulp.task('sass', function () {
// return sass(sassSrc)
// .pipe(gulp.dest('./dest/css/'));
// });
gulp.task('stylus', function () {
gulp.src(stylusSrc)
.pipe(stylus())
.pipe(gulp.dest('./dest/css/'));
});
gulp.task('html', function () {
gulp.src(htmlSrc)
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(coffeeSrc, ['coffee']);
//gulp.watch(cjsxSrc, ['cjsx']);
//gulp.watch(sassSrc, ['sass']);
gulp.watch(jadeSrc, ['jade']);
gulp.watch(stylusSrc, ['stylus']);
gulp.watch(htmlSrc, ['html']);
});
gulp.task('bower', function () {
return gulp.src(bowerFiles(), {
base: './bower_components'
})
.pipe(gulp.dest('./dest/libs/'));
});
gulp.task('connect', function () {
connect.server({
root: './dest/',
livereload: true
});
});
gulp.task('default', ['html', 'coffee', 'jade', 'stylus', 'connect', 'watch']);