-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.coffee
55 lines (44 loc) · 1.24 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
gulp = require 'gulp'
coffee = require 'gulp-coffee'
sourcemaps = require "gulp-sourcemaps"
mocha = require 'gulp-mocha'
nodemon = require 'gulp-nodemon'
# browserify = require 'gulp-browserify'
rename = require "gulp-rename"
# stylus = require 'gulp-stylus'
del = require 'del'
path = require 'path'
# watchify = require 'watchify'
# source = require 'vinyl-source-stream'
# coffeeify = require 'coffeeify'
sources =
code : [
'src/**/*.coffee'
]
test : 'test/**/*.coffee'
destinations =
code : 'build/'
gulp.task 'clean', (done) ->
dirs = (directory + '/*' for name, directory of destinations)
del dirs, done
gulp.task 'build', ['clean'], ->
gulp
.src sources.code
.pipe sourcemaps.init()
.pipe coffee()
.on "error", (error) -> console.error error
.pipe sourcemaps.write()
.pipe gulp.dest destinations.code
gulp.task 'watch', ->
gulp.watch sources.code, ['build']
gulp.watch [
sources.test
destinations.code
], ['test']
gulp.task 'test', ->
gulp.src sources.test
.pipe mocha
compilers : 'coffee:coffee-script'
reporter : 'spec'
gulp.task 'develop', ['build', 'test', 'watch']
gulp.task 'default', ['develop']