-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sending real sdk version from the SDK * clientversion * file name
- Loading branch information
1 parent
a5ae664
commit f341b8e
Showing
7 changed files
with
4,822 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ webpack.config.js | |
deploy.sh | ||
update-samples.sh | ||
.github/ | ||
gulpfile.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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('CONFIGCAT_SDK_VERSION', VERSION)) | ||
.pipe(gulp.dest(dst)); | ||
} | ||
|
||
function updateVersion_dist(){ | ||
return updateVersion(OUT_DIST, 'configcat.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)); |
Oops, something went wrong.