-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
34 lines (25 loc) · 808 Bytes
/
gulpfile.js
File metadata and controls
34 lines (25 loc) · 808 Bytes
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
var gulp = require("gulp");
var replace = require("gulp-replace");
var fs = require("fs");
const OUT_DIST = "dist";
const OUT_ESM = "lib/esm";
const OUT_LEGACY = "lib";
function updateVersion(dst, file) {
const VERSION = JSON.parse(fs.readFileSync("./package.json")).version;
return gulp.src(dst + "/" + file)
.pipe(replace("CONFIGDN_SDK_VERSION", VERSION))
.pipe(gulp.dest(dst));
}
function updateVersion_dist() {
return updateVersion(OUT_DIST, "configdn.js");
}
function updateVersion_esm() {
return updateVersion(OUT_ESM, "Version.js");
}
function updateVersion_legacy() {
return updateVersion(OUT_LEGACY, "Version.js");
}
exports.tsc = gulp.series(
gulp.parallel(updateVersion_esm, updateVersion_legacy));
exports.webpack = gulp.series(
gulp.parallel(updateVersion_dist));