-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
62 lines (51 loc) · 1.54 KB
/
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
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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
del = require('del'),
jshint = require('gulp-jshint'),
debug = require('gulp-debug'),
seq = require('run-sequence'),
jasmine = require('gulp-jasmine'),
merge = require('merge-stream');
gulp.task('compile', function() {
var min = gulp.src('src/chrometappydetector.js')
.pipe(uglify())
.pipe(rename("chrometappydetector.min.js"))
.pipe(gulp.dest('dist'));
var std = gulp.src('src/chrometappydetector.js')
.pipe(rename("chrometappydetector.js"))
.pipe(gulp.dest('dist'));
return merge(min,std);
});
gulp.task('clean',function() {
del(['dist/**/*']);
});
gulp.task('lint',function() {
return gulp.src('src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('test:lint',function() {
return gulp.src('test/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('test:run',function() {
return gulp.src('test/**/*.js')
.pipe(jasmine({
includeStackTrace: true
}));
});
gulp.task('test', function() {
seq('test:lint','test:run')
});
gulp.task('build',function(cb) {
seq(['lint','clean'],'test','compile',cb);
});
gulp.task('watch',function() {
gulp.watch(['src/**/*'],['build']);
gulp.watch(['test/**/*.js'],['test']);
});
gulp.task('default',['build','watch']);