diff --git a/packages/nitro/src/runtime/app/render.ts b/packages/nitro/src/runtime/app/render.ts index 151cee3c65..af2c479b1f 100644 --- a/packages/nitro/src/runtime/app/render.ts +++ b/packages/nitro/src/runtime/app/render.ts @@ -62,11 +62,15 @@ function renderHTML (payload, rendered, ssrContext) { const state = `` const _html = rendered.html + const { htmlAttrs = '', bodyAttrs = '', headTags = '', headAttrs = '' } = + (ssrContext.head && ssrContext.head()) || {} + return htmlTemplate({ - HTML_ATTRS: '', - HEAD_ATTRS: '', - BODY_ATTRS: '', - HEAD: rendered.renderResourceHints() + rendered.renderStyles() + (ssrContext.styles || ''), + HTML_ATTRS: htmlAttrs, + HEAD_ATTRS: headAttrs, + BODY_ATTRS: bodyAttrs, + HEAD: headTags + + rendered.renderResourceHints() + rendered.renderStyles() + (ssrContext.styles || ''), APP: _html + state + rendered.renderScripts() }) }