-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGulpfile.js
47 lines (40 loc) · 1.21 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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var mocha = require('gulp-mocha');
var coveralls = require('gulp-coveralls');
var rename = require('gulp-rename');
var lint = require('gulp-jshint');
gulp.task('build', function() {
return gulp.src('src/*.js')
.pipe(uglify())
.pipe(rename(function(path) {
path.extname = ".min.js";
}))
.pipe(gulp.dest('build'));
});
gulp.task('upload', function() {
return gulp.src('src/*.js')
.pipe(uglify())
.pipe(rename(function(path) {
path.extname = ".min.js";
}))
.pipe(gulp.dest('../chezstov.github.io'));
});
gulp.task('test', function() {
return gulp.src('spec/*.js', {read: false})
.pipe(mocha({reporter: 'nyan'}));
});
gulp.task('coveralls', function() {
return gulp.src('./coverage/lcov.info')
.pipe(coveralls());
});
gulp.task('lint', function() {
return gulp.src('src/*.js')
.pipe(lint())
.pipe(lint.reporter('jshint-stylish'));
});
gulp.task('watch', function() {
gulp.watch('src/*.js', ['build', 'upload', 'lint', 'test']);
gulp.watch('spec/*.js', ['test']);
});
gulp.task('default', ['build', 'lint', 'test', 'coveralls']);