forked from srfrnk/ng-device-detector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (35 loc) · 1.01 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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var karma = require('karma').server;
var git = require('gulp-git');
var bump = require('gulp-bump');
var filter = require('gulp-filter');
var tag_version = require('gulp-tag-version');
gulp.task('default', ["test"]);
gulp.task('minify', function () {
gulp.src('ng-device-detector.js')
.pipe(uglify())
.pipe(concat("ng-device-detector.min.js"))
.pipe(gulp.dest('.'))
});
/**
* Run test once and exit
*/
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
gulp.task('watch', [], function () {
gulp.watch(["**/*.js"], ["test"]);
});
gulp.task('version', ["minify"], function () {
gulp.src(['./package.json', './bower.json'])
.pipe(bump())
.pipe(gulp.dest('./'))
.pipe(git.commit('bumps package version'))
.pipe(filter('package.json'))
.pipe(tag_version());
});