-
Notifications
You must be signed in to change notification settings - Fork 43
/
gulpfile.js
44 lines (38 loc) · 1006 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
41
42
43
44
"use strict";
var gulp = require('gulp');
var git = require('gulp-git');
var bump = require('gulp-bump');
var tag_version = require('gulp-tag-version');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var Server = require('karma').Server;
function inc(importance) {
return gulp.src(['./package.json'])
.pipe(bump({type: importance}))
.pipe(gulp.dest('./'))
.pipe(git.commit('new package version'))
.pipe(tag_version());
}
gulp.task('patch', function () {
return inc('patch');
});
gulp.task('feature', function () {
return inc('minor');
});
gulp.task('release', function () {
return inc('major');
});
/**
* Run test once and exit
*/
gulp.task('test', function (done) {
new Server({
configFile: __dirname + '/karma.conf.js',
}, done).start();
});
gulp.task('min', function () {
return gulp.src(['dist/cytoscape-node-html-label.js'])
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist', {ext: '.min.js'}));
});