mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +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
|
} = result
|
||||||
|
|
||||||
if (redirected) {
|
if (redirected) {
|
||||||
nuxt.callHook('render:routeDone', url, result, context)
|
await nuxt.callHook('render:routeDone', url, result, context)
|
||||||
return html
|
return html
|
||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -35,7 +35,7 @@ export default ({ options, nuxt, renderRoute, resources }) => async function nux
|
|||||||
if (fresh(req.headers, { etag })) {
|
if (fresh(req.headers, { etag })) {
|
||||||
res.statusCode = 304
|
res.statusCode = 304
|
||||||
res.end()
|
res.end()
|
||||||
nuxt.callHook('render:routeDone', url, result, context)
|
await nuxt.callHook('render:routeDone', url, result, context)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
res.setHeader('ETag', etag)
|
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('Accept-Ranges', 'none') // #3870
|
||||||
res.setHeader('Content-Length', Buffer.byteLength(html))
|
res.setHeader('Content-Length', Buffer.byteLength(html))
|
||||||
res.end(html, 'utf8')
|
res.end(html, 'utf8')
|
||||||
nuxt.callHook('render:routeDone', url, result, context)
|
await nuxt.callHook('render:routeDone', url, result, context)
|
||||||
return html
|
return html
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
|
Loading…
Reference in New Issue
Block a user