-
Notifications
You must be signed in to change notification settings - Fork 21
/
gulpfile.js
96 lines (86 loc) · 1.99 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
var concat = require("gulp-concat");
const src = {
all: [
'./src/orb.js',
'./src/core.js',
'./src/time.js',
'./src/earth.js',
'./src/nutation.js',
'./src/coordinates.js',
'./src/observation.js',
'./src/sgp4.js',
'./src/kepler.js',
'./src/sun.js',
'./src/luna.js',
'./src/vsop.js'
],
core: [
'./src/orb.js',
'./src/core.js',
'./src/time.js',
'./src/earth.js',
'./src/nutation.js',
'./src/coordinates.js',
'./src/observation.js'
],
planetary: [
'./src/orb.js',
'./src/core.js',
'./src/time.js',
'./src/earth.js',
'./src/nutation.js',
'./src/coordinates.js',
'./src/observation.js',
'./src/kepler.js',
'./src/sun.js',
'./src/luna.js',
'./src/vsop.js'
],
satellite: [
'./src/orb.js',
'./src/core.js',
'./src/time.js',
'./src/earth.js',
'./src/nutation.js',
'./src/coordinates.js',
'./src/observation.js',
'./src/sgp4.js'
]
}
const concat_scripts = function (done) {
gulp.src(src.all)
.pipe(concat('orb.v2.js'))
.pipe(gulp.dest('./build'));
gulp.src(src.core)
.pipe(concat('orb-core.v2.js'))
.pipe(gulp.dest('./build'));
gulp.src(src.planetary)
.pipe(concat('orb-planetary.v2.js'))
.pipe(gulp.dest('./build'));
gulp.src(src.satellite)
.pipe(concat('orb-satellite.v2.js'))
.pipe(gulp.dest('./build'));
done()
return
}
const copy_scripts = function (done) {
var supplement = [
"src/orb-date-handler.js",
"src/orb-data-handler.js"
]
return gulp.src(supplement)
.pipe(gulp.dest('./build'));
};
const minify_scripts = function (done) {
return gulp.src("./build/*.js")
.pipe(uglify())
.pipe(rename({
extname: '.min.js'
}))
.pipe(gulp.dest('./build/min'));
};
exports.build = gulp.series(concat_scripts, copy_scripts, minify_scripts);
exports.minify = gulp.series(minify_scripts);