-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
39 lines (32 loc) · 890 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
var gulp = require('gulp');
var karma = require('karma').server;
var karmaConfig = require('./karma.conf');
var clean = require('gulp-clean');
var uglify = require('gulp-uglify');
var ngAnnotate = require('gulp-ng-annotate');
gulp.task('clean:dist', function () {
return gulp.src('dist')
.pipe(clean());
});
gulp.task('build', ['clean:dist'], function() {
return gulp.src('src/**/*.js')
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('test', function () {
karmaConfig({
set: function (testConfig) {
extend(testConfig, {
singleRun: ciMode,
autoWatch: !ciMode,
browsers: ['PhantomJS']
});
karma.start(testConfig, function (exitCode) {
plugins.util.log('Karma has exited with ' + exitCode);
process.exit(exitCode);
});
}
});
});
gulp.task('default', ['build']);