bugfix: Use window load event instead of RequestIdleCallback
requestIdleCallback is not supported on Safari based browsers
This commit is contained in:
@@ -65,7 +65,7 @@ export default defineConfig({
|
|||||||
format: 'esm',
|
format: 'esm',
|
||||||
target: 'es2023',
|
target: 'es2023',
|
||||||
})
|
})
|
||||||
return `<script>requestIdleCallback(()=>{${result.outputFiles[0].text}})</script>`
|
return `<script>window.addEventListener('load',()=>{${result.outputFiles[0].text}})</script>`
|
||||||
} else {
|
} else {
|
||||||
const content = readFileSync(join(ROOT, filepath), 'utf8')
|
const content = readFileSync(join(ROOT, filepath), 'utf8')
|
||||||
return `<${tag}>\n${content}</${tag}>`
|
return `<${tag}>\n${content}</${tag}>`
|
||||||
|
|||||||
Reference in New Issue
Block a user