perf(nuxt): use static import of @unhead/ssr (#9826)

This commit is contained in:
Yann Odeyer 2022-12-23 14:18:14 +01:00 committed by GitHub
parent 65860d327d
commit da6fa9ab44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
import { createHead, useHead } from '@vueuse/head' import { createHead, useHead } from '@vueuse/head'
import { renderSSRHead } from '@unhead/ssr'
import { defineNuxtPlugin } from '#app' import { defineNuxtPlugin } from '#app'
// @ts-expect-error untyped // @ts-expect-error untyped
import { appHead } from '#build/nuxt.config.mjs' import { appHead } from '#build/nuxt.config.mjs'
@ -29,7 +30,6 @@ export default defineNuxtPlugin((nuxtApp) => {
if (process.server) { if (process.server) {
nuxtApp.ssrContext!.renderMeta = async () => { nuxtApp.ssrContext!.renderMeta = async () => {
const { renderSSRHead } = await import('@unhead/ssr')
const meta = await renderSSRHead(head.unhead) const meta = await renderSSRHead(head.unhead)
return { return {
...meta, ...meta,