perf(nuxt): don't tree-shake useServerHead in dev (#26421)

This commit is contained in:
Daniel Roe 2024-03-21 12:17:09 +00:00 committed by GitHub
parent 8c3159f4ba
commit 57b8d977b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,9 +29,11 @@ export default defineNuxtModule({
} }
// allow @unhead/vue server composables to be tree-shaken from the client bundle // allow @unhead/vue server composables to be tree-shaken from the client bundle
nuxt.options.optimization.treeShake.composables.client['@unhead/vue'] = [ if (!nuxt.options.dev) {
'useServerHead', 'useServerSeoMeta', 'useServerHeadSafe' nuxt.options.optimization.treeShake.composables.client['@unhead/vue'] = [
] 'useServerHead', 'useServerSeoMeta', 'useServerHeadSafe'
]
}
addImportsSources({ addImportsSources({
from: '@unhead/vue', from: '@unhead/vue',