N
Nuxt17mo ago
oemer

What is the equivalent to `beforeNuxtRender` in Nuxt 3?

In Nuxt 2 it was in the plugin context:
export default function somePlugin(({ beforeNuxtRender }) => {})
export default function somePlugin(({ beforeNuxtRender }) => {})
In Nuxt 3 we have hooks, but there doesn't seem to be the right hook for that?
export default defineNuxtPlugin((nuxt) => {
nuxt.hook()
})
export default defineNuxtPlugin((nuxt) => {
nuxt.hook()
})
1 Reply
oemer
oemerOP17mo ago
Could it be a nitro plugin?
nitroApp.hooks.hook('render:html', (html, { event }) => {
console.log('render:html', html)
html.head.push('<script>...</script>')
})
nitroApp.hooks.hook('render:html', (html, { event }) => {
console.log('render:html', html)
html.head.push('<script>...</script>')
})
Want results from more Discord servers?
Add your server