-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (28 loc) · 1.09 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
const package = require("./package.json");
const gulp = require("gulp");
const strip = require("gulp-strip-comments");
const header = require("gulp-header");
const minify = require("gulp-uglify-es").default;
const rename = require("gulp-rename");
const replace = require("gulp-replace");
const top = (done) => gulp.src("top.js")
.pipe(replace("#VERSION#", package.version))
.pipe(replace("#YEAR#", new Date().getFullYear()))
.pipe(strip())
.pipe(minify())
.pipe(header("#!/usr/bin/env node\n"))
.pipe(rename("mongotopx"))
.pipe(gulp.dest("./build"));
const stat = (done) => gulp.src("stat.js")
.pipe(replace("#VERSION#", package.version))
.pipe(replace("#YEAR#", new Date().getFullYear()))
.pipe(strip())
.pipe(minify())
.pipe(header("#!/usr/bin/env node\n"))
.pipe(rename("mongostatx"))
.pipe(gulp.dest("./build"));
const license = (done) => gulp.src("license.txt")
.pipe(replace("#VERSION#", package.version))
.pipe(replace("#YEAR#", new Date().getFullYear()))
.pipe(gulp.dest("./build"));
exports.default = gulp.series(top, stat, license);