-
Notifications
You must be signed in to change notification settings - Fork 30
/
gulpfile.coffee
64 lines (54 loc) · 1.35 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
bower = require 'gulp-bower'
browserify = require 'browserify'
buffer = require 'gulp-buffer'
coffee = require 'gulp-coffee'
concat = require 'gulp-concat'
fs = require 'fs'
gulp = require 'gulp'
gulpif = require 'gulp-if'
gutil = require 'gulp-util'
jade = require 'gulp-jade'
nib = require 'nib'
Path = require 'path'
replace = require 'gulp-replace'
source = require 'vinyl-source-stream'
stylus = require 'gulp-stylus'
uglify = require 'gulp-uglify'
handleError = (err) ->
gutil.log err
gutil.beep()
@emit 'end'
process.exit(1)
STYLUS_OPTS =
use: [nib()]
errors: true
paths: [
__dirname
Path.join(__dirname, 'bower_components')
]
gulp.task 'js', ->
gulp.src(['./coffee/**/*.coffee'])
.pipe(gulpif(/[.]coffee$/, coffee().on('error', handleError)))
.pipe(gulp.dest('./js'))
gulp.task 'css', ->
gulp.src('./styl/**/*.styl')
.pipe(stylus(STYLUS_OPTS))
.on('error', handleError)
.pipe(gulp.dest('./css'))
gulp.task 'html', ->
gulp.src('./jade/**/*.jade')
.pipe(jade().on('error', handleError))
.pipe(gulp.dest('./'))
gulp.task 'watch', ->
gulp.watch ['./coffee/**'], ['js']
gulp.watch ['./styl/**'], ['css']
gulp.watch ['./jade/**'], ['html']
gulp.task 'build', [
'js'
'css'
'html'
]
gulp.task 'default', [
'build'
'watch'
]