forked from jdforsythe/angular-aba-routing-validation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (30 loc) · 935 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
'use strict';
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const KarmaServer = require('karma').Server;
const path = require('path');
gulp.task('lint', function() {
gulp.src('./src/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('dist', ['lint', 'test'], function() {
// first copy the pretty version to ./dist
gulp.src('./src/angular-aba-routing-validation.js')
.pipe(gulp.dest('./dist'));
gulp.src('./src/angular-aba-routing-validation.js')
.pipe(uglify({
preserveComments: 'license',
}))
.pipe(rename('angular-aba-routing-validation.min.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('test', function(done) {
new KarmaServer({
configFile: path.join(__dirname, '/karma.conf.js'),
singleRun: true,
}, done).start();
});