let fs = require('fs')
function embedHtml(src, dst) {
fs.readFile(src, 'utf8', function(err, data) {
if(err) throw err;
data = "(window)['"+src.replace(/^.*[\\\/]/, '')+"'] = `" + data + "`;";
fs.writeFile(dst, data, function(err) {
if(err) throw err;
});
});
}
function embedCss(src, dst) {
fs.readFile(src, 'utf8', function(err, data) {
if(err) throw err;
data = "(window)['"+src.replace(/^.*[\\\/]/, '')+"'] = ``;";
data = data.replace(/"/g, "'");
fs.writeFile(dst, data, function(err) {
if(err) throw err;
});
});
}
function embedSvg(src, dst) {
fs.readFile(src, 'utf8', function(err, data) {
if(err) throw err;
data = data.replace(/<\?xml[^\?]*\?>[\r\n]*/g, '');
data = data.replace(/