mosaic-widgets/gulpfile.js

22 lines
775 B
JavaScript
Raw Normal View History

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'])
.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/'));
};
exports.default = replaceTemplate;