-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgulpfile.coffee
More file actions
51 lines (44 loc) · 1.31 KB
/
gulpfile.coffee
File metadata and controls
51 lines (44 loc) · 1.31 KB
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
gulp = require 'gulp'
coffee = require 'gulp-coffee'
gutil = require 'gulp-util'
shell = require 'gulp-shell'
fs = require 'fs'
mocha = require 'gulp-mocha'
watch = require 'gulp-watch'
replace = require 'gulp-replace'
rename = require 'gulp-rename'
uglify = require 'gulp-uglify'
chai = require 'chai'
sinonChai = require 'sinon-chai'
gulp.task 'default', ['build', 'docs', 'uglify']
gulp.task 'watch', ->
gulp.watch('./src/*.coffee', ['default'])
gulp.task 'coffee', ->
gulp
.src('./src/*.coffee')
.pipe(coffee(bare: true)
.on('error', gutil.log))
.pipe gulp.dest('./dist/')
gulp.task 'build', ['coffee'], ->
gulp
.src('./src/*.coffee')
.pipe(replace(/(.*) = require (.*)/g, ''))
.pipe(replace('module.exports = Databound', ''))
.pipe(coffee(bare: true)
.on('error', gutil.log))
.pipe(rename('databound-standalone.js'))
.pipe(gulp.dest('./dist/'))
gulp.task 'uglify', ['build'], ->
gulp
.src('./dist/databound-standalone.js')
.pipe(uglify())
.pipe(rename('databound-standalone.min.js'))
.pipe(gulp.dest('./dist/'))
gulp.task 'docs', shell.task('node_modules/groc/bin/groc src/*.coffee')
gulp.task 'test', ->
chai.use(sinonChai)
global.expect = chai.expect
gulp.src('spec/**/*.coffee', read: false)
.pipe(mocha(
reporter: 'spec'
).on('error', gutil.log))