mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
perf(nuxt): use static import of @unhead/ssr
(#9826)
This commit is contained in:
parent
65860d327d
commit
da6fa9ab44
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user