feat: 调整下载全部通过 rs 能力实现

This commit is contained in:
jeasonnow
2023-06-25 15:24:10 +08:00
parent 3c97825b54
commit f70920dbbe
4 changed files with 40 additions and 13 deletions

View File

@@ -6,7 +6,8 @@ export default async function combineFiles(files: string[], output: string) {
if (file.endsWith('.css')) {
return "window.addEventListener('DOMContentLoaded', (_event) => { const css = `" + fileContent + "`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });";
}
return fileContent;
return "window.addEventListener('DOMContentLoaded', (_event) => { " + fileContent + " });";
});
fs.writeFileSync(output, contents.join('\n'));
return files;