From 67456810beb93a008bbc8e48ceb9f7f30ab6db79 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 17 Nov 2024 16:48:26 -0500 Subject: [PATCH] fix(nuxt): do not include `` when building (#29956) Co-authored-by: Julien Huang --- packages/nuxt/src/core/nuxt.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 3ec1329178..835d71c9bd 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -408,11 +408,15 @@ async function initNuxt (nuxt: Nuxt) { } // Add - addComponent({ - name: 'NuxtWelcome', - priority: 10, // built-in that we do not expect the user to override - filePath: resolve(nuxt.options.appDir, 'components/welcome'), - }) + // TODO: revert when deep server component config is properly bundle-split: https://github.com/nuxt/nuxt/pull/29956 + const islandsConfig = nuxt.options.experimental.componentIslands + if (nuxt.options.dev || !(typeof islandsConfig === 'object' && islandsConfig.selectiveClient === 'deep')) { + addComponent({ + name: 'NuxtWelcome', + priority: 10, // built-in that we do not expect the user to override + filePath: resolve(nuxt.options.appDir, 'components/welcome'), + }) + } addComponent({ name: 'NuxtLayout',