-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
41 lines (37 loc) · 1005 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
40
41
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
// Lint JS
gulp.task('lint:js',['concat:js'], function() {
return gulp.src('dist/gpredict.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
// Concatenate JS
gulp.task('concat:js', function(){
return gulp.src([
'js/orbit_tools.js',
'js/sgp_in.js',
'js/sgp4sdp4.js',
'js/predict-tools.js',
'js/sgp_time.js',
'js/sgp_obs.js',
'js/math.js',
'js/gtk-sat-data.js',
'js/qth-data.js',
'js/sgp_math.js'])
.pipe(concat('gpredict.js'))
.pipe(gulp.dest('./dist/'));
});
// Minify JS
gulp.task('minify:js', function() {
return gulp.src('dist/gpredict.js')
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));
});
// Default
gulp.task('default', ['lint:js', 'concat:js', 'minify:js']);