Nuxt/test/fixtures/basic/server/plugins/basicRenderDelayedHydration.ts

6 lines
381 B
TypeScript
Raw Normal View History

export default defineNitroPlugin((nitroApp) => {
2024-04-14 11:06:56 +00:00
nitroApp.hooks.hook('render:html', (html, { event }) => {
2024-06-02 06:47:41 +00:00
html.head = html.head.map((headSection: string) => headSection.replace(/<link((?=[^>]+\bhref="\/_nuxt\/DelayedWrapperTestComponent\.([^.]+)\.js")[^>]+>)/, '')) // .replace(/<link rel="preload" href="\/_nuxt\/DelayedWrapperTestComponent\.js" as="script">/, "")
2024-04-14 11:06:56 +00:00
})
})