-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (29 loc) · 854 Bytes
/
gulpfile.js
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
var gulp = require('gulp');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var mocha = require('gulp-mocha');
gulp.task('default', ['bundle']);
gulp.task('bundle', function() {
var bundler = watchify('./src/fastdate.js');
bundler.on('update', rebundle);
function rebundle () {
return bundler.bundle({ standalone: 'fastdate' })
// log errors if they happen
.on('error', function(e) {
gutil.log('Browserify Error', e);
})
.pipe(source('fastdate.js'))
.pipe(gulp.dest('.'));
}
return rebundle();
});
gulp.task('mocha', function() {
return gulp.src(['test/*.js'], { read: false })
.pipe(mocha({
reporter: 'spec',
globals: {
should: require('should')
}
}));
});