-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
65 lines (53 loc) · 1.57 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
# Gulp stuff.
gulp = require('gulp')
gutil = require('gulp-util')
coffee = require('gulp-coffee')
sourcemaps = require('gulp-sourcemaps')
touch = require('touch')
path = require('path')
tap = require('gulp-tap')
sh = require('shelljs')
jade = require('gulp-jade')
stylus = require('gulp-stylus')
parallelize = require("concurrent-transform")
threads = 100
useSourceMaps = true
coffeeFiles = ['./gulpfile.coffee','./src/**/*.coffee','./test/**/*.coffee','./server/**/*.coffee']
jadeFiles = ['./server/**/*.jade']
stylusFiles = ['./server/**/*.styl']
handleError = (err) ->
console.log(err.toString())
@emit('end')
gulp.task('touch', () ->
gulp.src(coffeeFiles)
.pipe(
tap((file, t) ->
touch(file.path)
)
)
)
gulp.task('coffeescripts', () ->
gulp.src(coffeeFiles)
.pipe(parallelize(coffee({bare: true}).on('error', gutil.log), threads))
.pipe(parallelize((if useSourceMaps then sourcemaps.init() else gutil.noop()), threads))
)
gulp.task('jadescripts', () ->
gulp.src(jadeFiles)
.pipe(parallelize(jade().on('error', gutil.log), threads))
)
gulp.task('stylusscripts', () ->
gulp.src(stylusFiles)
.pipe(parallelize(stylus().on('error', gutil.log), threads))
)
gulp.task('one', () ->
return gulp.src('./css/one.styl')
.pipe(stylus())
.pipe(gulp.dest('./css/build'))
)
gulp.task('watch', () ->
gulp.watch(coffeeFiles, ['coffeescripts'])
gulp.watch(jadeFiles, ['jadescripts'])
gulp.watch(stylusFiles, ['stylusscripts'])
)
gulp.task('default', ['watch', 'coffeescripts'])
gulp.task('done', (() -> ))