forked from khozlov/perficio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
60 lines (52 loc) · 1.42 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
58
59
60
var gulp = require('gulp'),
jade = require('gulp-jade'),
stylus = require('gulp-stylus'),
hogan = require('gulp-hogan'),
config = require('config'),
mainBowerFiles = require('main-bower-files'),
mocha = require('gulp-mocha');
// --- Basic Tasks ---
gulp.task('css', function() {
return gulp.src('src/assets/stylesheets/*.styl')
.pipe(stylus({
set: ['compress']
}))
.pipe(gulp.dest('public/assets/css'));
});
gulp.task('js', function() {
return gulp.src('src/assets/js/*.mustache')
.pipe(hogan({
mountPoint: config.get('mountPoint')
}))
.pipe(gulp.dest('public/assets/js/'));
});
gulp.task('templates', function() {
return gulp.src('src/**/*.jade')
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest('public/'));
});
gulp.task('watch', function() {
gulp.watch('src/assets/stylesheets/*.styl', ['css']);
gulp.watch('src/assets/js/*.js.mustache', ['js']);
gulp.watch('src/**/*.jade', ['templates']);
});
gulp.task("vendor", function() {
return gulp.src(mainBowerFiles( /* options */ ), {
base: 'bower_components/'
}).pipe(gulp.dest('public/assets/vendor/'));
});
gulp.task('test', function() {
return gulp.src('test/**/*.js', {
read: false
})
.pipe(mocha({
reporter: 'spec' //or nyan :)
}))
.once('end', function() {
process.exit();
});
});
// Default Task
gulp.task('default', ['js', 'css', 'templates', 'vendor', 'watch']);