2023-06-06 18:46:13 +00:00
|
|
|
const replace = require('gulp-replace');
|
|
|
|
const { src, dest } = require('gulp');
|
|
|
|
require('dotenv/config');
|
|
|
|
|
|
|
|
// or replace multiple strings
|
|
|
|
function replaceTemplate() {
|
2023-06-06 22:22:47 +00:00
|
|
|
src(['./dist/js/**/*.js'])
|
2023-06-06 18:46:13 +00:00
|
|
|
.pipe(replace(/TEASENSE_URI/g, process.env.TEASENSE_URI))
|
|
|
|
.pipe(replace(/RAINFALL_URI/g, process.env.RAINFALL_URI))
|
2023-06-06 21:57:43 +00:00
|
|
|
.pipe(replace(/SPLORK_URI/g, process.env.SPLORK_URI))
|
2023-06-12 12:49:05 +00:00
|
|
|
.pipe(replace(/RSS_ORIGIN/g, process.env.RSS_ORIGIN))
|
|
|
|
.pipe(replace(/RSS_API_HOST/g, process.env.RSS_API_HOST))
|
|
|
|
.pipe(replace(/RSS_API_KEY/g, process.env.RSS_API_KEY))
|
2023-06-06 22:22:47 +00:00
|
|
|
.pipe(dest('./dist/js'));
|
|
|
|
|
|
|
|
return src(['./dist/**/*.html'])
|
|
|
|
.pipe(replace(/FONTAWESOME_SCRIPT_URL/g, process.env.FONTAWESOME_SCRIPT_URL))
|
|
|
|
.pipe(dest('./dist/'));
|
|
|
|
|
2023-06-06 18:46:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.default = replaceTemplate;
|