From 57b8d977b94b5e450fdacad603237a4db6cd3d09 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 21 Mar 2024 12:17:09 +0000 Subject: [PATCH] perf(nuxt): don't tree-shake `useServerHead` in dev (#26421) --- packages/nuxt/src/head/module.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/nuxt/src/head/module.ts b/packages/nuxt/src/head/module.ts index 5964ecc527..646f206aa1 100644 --- a/packages/nuxt/src/head/module.ts +++ b/packages/nuxt/src/head/module.ts @@ -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',