-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gulpfile.js
37 lines (30 loc) · 832 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
36
37
var gulp = require('gulp');
$ = require('gulp-load-plugins')();
var paths = {
src: ['quadtree.js'],
tests: 'test/*.js',
dist: 'quadtree.min.js',
};
gulp.task('lint', function(){
return gulp.src(paths.src)
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.notify({message: 'Linting Done'}));
});
gulp.task('uglify', function(){
return gulp.src(paths.src)
.pipe($.uglify())
.pipe($.rename(paths.dist))
.pipe(gulp.dest(''))
.pipe($.notify({message: 'Build Done'}));
});
gulp.task('watch', function(){
gulp.watch(paths.src, ['lint']);
});
//run tests once
gulp.task('test', function(){
return gulp.src(paths.tests, {read: false})
.pipe($.mocha({reporter: 'nyan'}));
});
gulp.task('build', ['lint', 'uglify']);
gulp.task('default', ['build', 'watch']);