-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
40 lines (34 loc) · 954 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
38
39
40
"use strict";
var gulp = require('gulp');
var esl = require('gulp-eslint');
var git = require('gulp-git');
var tag = require('gulp-tag-version');
var babel = require('gulp-babel');
var bump = require('gulp-bump');
var mocha = require('mocha');
var KarmaServer = require('karma').Server;
gulp.task('lint', function () {
return gulp.src(['src/**/*.js','test/**/*.js','!node_modules/**'])
.pipe(esl())
.pipe(esl.format())
.pipe(esl.failAfterError());
});
gulp.task('build',['test'],function() {
return gulp.src("src/**/*.js")
.pipe(babel())
.pipe(gulp.dest("dist"));
});
gulp.task('test',['lint'],function() {
return new KarmaServer({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}).start();
});
gulp.task('version-bump',function() {
gulp.src('./package.json')
.pipe(bump())
.pipe(gulp.dest('./'))
.pipe(git.commit('bumps package version'))
.pipe(tag());
});
gulp.task('default',['build']);