-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgulpfile.coffee
85 lines (70 loc) · 1.89 KB
/
gulpfile.coffee
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
85
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 = (taskName) ->
return ->
gutil.beep.apply(arguments)
gutil.log.apply(arguments)
gulp.task 'gulp', ->
gulp.src(['./gulpfile.coffee']).pipe(coffee())
.pipe(gulp.dest('./'))
gulp.task 'coffee', ->
coffeeStream = coffee()
.on('error', handleError('coffee'))
try
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 e
gutil.log e
gulp.task 'plugins', ->
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', ->
stylusStream = stylus({use: ['nib']})
.on('error', handleError('stylus'))
gulp.src('./styl/index.styl')
.pipe(plumber())
.pipe(stylusStream)
.pipe(gulp.dest('./css/'))
gulp.task 'jade', ->
jadeStream = jade({pretty: true})
.on('error', handleError('jade'))
gulp.src('./jade/*')
.pipe(plumber())
.pipe(jadeStream)
.pipe(gulp.dest('./'))
gulp.task 'watch-coffee', ->
gulp.watch './coffee/*', ->
gulp.run 'coffee'
gulp.task 'watch-stylus', ->
gulp.watch './styl/*', ->
gulp.run 'stylus'
gulp.task 'watch-jade', ->
gulp.watch './jade/*', ->
gulp.run 'jade'
gulp.task 'default', ->
gulp.run 'coffee', 'stylus', 'jade', 'plugins', 'watch-coffee', 'watch-jade', 'watch-stylus'