This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
gulpfile.js
44 lines (39 loc) · 1.16 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
var gulp = require('gulp');
var gutil = require('gulp-util');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var eslint = require('gulp-eslint');
var Karma = require('karma').Server;
var argv = require('minimist')(process.argv.slice(2));
gulp.task('lint', function () {
return gulp
.src(['test/**/!(bind.poly).js', 'src/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('test', function (done) {
new Karma({
configFile: __dirname + '/karma.conf.js',
singleRun: !argv.tdd
}, done).start();
});
gulp.task('test:browser', function (done) {
new Karma({
configFile: __dirname + '/karma.conf.js',
singleRun: !argv.tdd,
browsers: [ 'Firefox', 'Chrome', 'Opera' ]
}, done).start();
});
gulp.task('build', function () {
return gulp
.src('src/bindNotifier.js')
.pipe(rename('angular-bind-notifier.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('angular-bind-notifier.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('ci', ['lint', 'test']);
gulp.task('package', ['lint', 'test', 'build']);
gulp.task('default', ['build']);