bugfix: Use window load event instead of RequestIdleCallback

requestIdleCallback is not supported on Safari based browsers
This commit is contained in:
2026-06-15 13:14:05 -07:00
parent 8242fdbbb3
commit e117d4cbcc
+1 -1
View File
@@ -65,7 +65,7 @@ export default defineConfig({
format: 'esm',
target: 'es2023',
})
return `<script>requestIdleCallback(()=>{${result.outputFiles[0].text}})</script>`
return `<script>window.addEventListener('load',()=>{${result.outputFiles[0].text}})</script>`
} else {
const content = readFileSync(join(ROOT, filepath), 'utf8')
return `<${tag}>\n${content}</${tag}>`