-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgulpfile.js
82 lines (64 loc) · 2.38 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
(function() {
var coffee, concat, gulp, gutil, handleError, jade, plumber, stylus;
gulp = require('gulp');
stylus = require('gulp-stylus');
jade = require('gulp-jade');
coffee = require('gulp-coffee');
concat = require('gulp-concat');
gutil = require('gulp-util');
plumber = require('gulp-plumber');
handleError = function(taskName) {
return function() {
gutil.beep.apply(arguments);
return gutil.log.apply(arguments);
};
};
gulp.task('gulp', function() {
return gulp.src(['./gulpfile.coffee']).pipe(coffee()).pipe(gulp.dest('./'));
});
gulp.task('coffee', function() {
var coffeeStream, e;
coffeeStream = coffee().on('error', handleError('coffee'));
try {
return gulp.src(['./coffee/setup.coffee', './coffee/AppView.coffee', './coffee/SectionModel.coffee', './coffee/SectionCollection.coffee', './coffee/SectionView.coffee', './coffee/SectionsView.coffee', './coffee/app.coffee']).pipe(plumber()).pipe(coffeeStream).pipe(concat("app.js")).pipe(gulp.dest('./js/'));
} catch (_error) {
e = _error;
return gutil.log(e);
}
});
gulp.task('plugins', function() {
return gulp.src(['./js/jquery.js', './js/jquery-ui.js', './js/underscore.js', './js/backbone.js', './js/d3.js', './js/medium-editor.js']).pipe(plumber()).pipe(concat("plugins.js")).pipe(gulp.dest('./js/'));
});
gulp.task('stylus', function() {
var stylusStream;
stylusStream = stylus({
use: ['nib']
}).on('error', handleError('stylus'));
return gulp.src('./styl/index.styl').pipe(plumber()).pipe(stylusStream).pipe(gulp.dest('./css/'));
});
gulp.task('jade', function() {
var jadeStream;
jadeStream = jade({
pretty: true
}).on('error', handleError('jade'));
return gulp.src('./jade/*').pipe(plumber()).pipe(jadeStream).pipe(gulp.dest('./'));
});
gulp.task('watch-coffee', function() {
return gulp.watch('./coffee/*', function() {
return gulp.run('coffee');
});
});
gulp.task('watch-stylus', function() {
return gulp.watch('./styl/*', function() {
return gulp.run('stylus');
});
});
gulp.task('watch-jade', function() {
return gulp.watch('./jade/*', function() {
return gulp.run('jade');
});
});
gulp.task('default', function() {
return gulp.run('coffee', 'stylus', 'jade', 'plugins', 'watch-coffee', 'watch-jade', 'watch-stylus');
});
}).call(this);