fix: remove the preload for SSR render of delayed hydration

This commit is contained in:
Michael Brevard 2024-04-14 14:04:45 +03:00 committed by GitHub
parent 0cb15c6bbd
commit 850287bf18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,5 @@
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook("render:html", (html, {event})=>{
html.head = html.head.map((headSection:string)=>headSection.replace(/<link((?=[^>]+\bhref="\/_nuxt\/DelayedWrapperTestComponent\.([^.]+?)\.js")[^>]+>)/, "")) //.replace(/<link rel="preload" href="\/_nuxt\/DelayedWrapperTestComponent\.js" as="script">/, "")
})
})