Skip to content

Commit

Permalink
perf(nuxt): don't tree-shake useServerHead in dev (#26421)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 21, 2024
1 parent 8c3159f commit 57b8d97
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/nuxt/src/head/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ export default defineNuxtModule({
}

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

addImportsSources({
from: '@unhead/vue',
Expand Down

0 comments on commit 57b8d97

Please sign in to comment.