-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
40 lines (33 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 KarmaServer = require('karma').Server;
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var ngAnnotate = require('gulp-ng-annotate');
var mainBowerFiles = require('main-bower-files');
gulp.task('default', ['watch']);
gulp.task('js', function () {
var files = [].concat(
'lib/simple-paginator/simple-paginator.js',
'lib/simple-resource/simple-resource.js',
'lib/simple-resource/**/*.js'
);
return gulp.src(files)
.pipe(ngAnnotate())
.pipe(concat('simple-resource.js'))
.pipe(gulp.dest('dist'))
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('dist'));
});
gulp.task('dist', ['js']);
gulp.task('test', function (done) {
return new KarmaServer({
configFile: __dirname + '/test/karma.conf.js',
singleRun: true
}, done()).start();
});
gulp.task('watch', function () {
gulp.watch('lib/**/*.js', ['dist', 'test']);
gulp.watch('test/**/*-spec.js', ['test']);
});