forked from nextcloud/contacts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (42 loc) · 1.11 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
41
42
43
44
45
46
47
var gulp = require('gulp'),
concat = require('gulp-concat'),
eslint = require('gulp-eslint'),
ngAnnotate = require('gulp-ng-annotate'),
KarmaServer = require('karma').Server,
sourcemaps = require('gulp-sourcemaps');
gulp.task('default', ['eslint'], function() {
return gulp.src([
'js/main.js',
'js/components/**/*.js',
'js/models/**/*.js',
'js/services/**/*.js',
'js/filters/**/*.js'
])
// concat (+sourcemaps)
.pipe(sourcemaps.init())
.pipe(ngAnnotate({ single_quotes: true }))
.pipe(concat('script.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('js/public'));
});
gulp.task('eslint', function() {
return gulp.src([
'js/main.js',
'js/components/**/*.js',
'js/models/**/*.js',
'js/services/**/*.js',
'js/filters/**/*.js'
])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('watch', ['default'], function() {
gulp.watch(['js/**/*.js', '!js/public/**/*.js'], ['default']);
});
gulp.task('karma', function(done){
new KarmaServer({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start();
});