mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-07 10:16:38 +08:00
适配ios端
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import fs from 'fs';
|
||||
|
||||
console.time('转换耗时');
|
||||
const distPath = './dist/index.html';
|
||||
let htmlText = fs.readFileSync(distPath, 'utf8');
|
||||
let resultText = '';
|
||||
let htmlArr = htmlText.match(/.*\n/g) || [];
|
||||
htmlArr.forEach(str => {
|
||||
str = str.replace(/\s?nomodule\s?/g,' ');
|
||||
str = str.replace(/\s?crossorigin\s?/g,' ');
|
||||
str = str.replace(/data-src/g,'src');
|
||||
if(!/type="module"/i.test(str)) resultText += str;
|
||||
});
|
||||
fs.writeFileSync(distPath,resultText,'utf8');
|
||||
console.timeEnd('转换耗时');
|
||||
Reference in New Issue
Block a user