mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix: await buildDone hook (#4955)
This commit is contained in:
parent
5b59577610
commit
f40f3f92c1
@ -22,7 +22,7 @@ export default ({ options, nuxt, renderRoute, resources }) => async function nux
|
||||
} = result
|
||||
|
||||
if (redirected) {
|
||||
nuxt.callHook('render:routeDone', url, result, context)
|
||||
await nuxt.callHook('render:routeDone', url, result, context)
|
||||
return html
|
||||
}
|
||||
if (error) {
|
||||
@ -35,7 +35,7 @@ export default ({ options, nuxt, renderRoute, resources }) => async function nux
|
||||
if (fresh(req.headers, { etag })) {
|
||||
res.statusCode = 304
|
||||
res.end()
|
||||
nuxt.callHook('render:routeDone', url, result, context)
|
||||
await nuxt.callHook('render:routeDone', url, result, context)
|
||||
return
|
||||
}
|
||||
res.setHeader('ETag', etag)
|
||||
@ -74,7 +74,7 @@ export default ({ options, nuxt, renderRoute, resources }) => async function nux
|
||||
res.setHeader('Accept-Ranges', 'none') // #3870
|
||||
res.setHeader('Content-Length', Buffer.byteLength(html))
|
||||
res.end(html, 'utf8')
|
||||
nuxt.callHook('render:routeDone', url, result, context)
|
||||
await nuxt.callHook('render:routeDone', url, result, context)
|
||||
return html
|
||||
} catch (err) {
|
||||
/* istanbul ignore if */
|
||||
|
Loading…
Reference in New Issue
Block a user