mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-22 08:29:46 +00:00
perf(nuxt): skip adding selective-client code if not enabled (#26176)
This commit is contained in:
parent
f772e564c8
commit
6723123a2e
@ -259,6 +259,7 @@ export default defineComponent({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (selectiveClient) {
|
||||||
if (import.meta.server) {
|
if (import.meta.server) {
|
||||||
for (const [id, info] of Object.entries(payloads.components ?? {})) {
|
for (const [id, info] of Object.entries(payloads.components ?? {})) {
|
||||||
const { html, slots } = info
|
const { html, slots } = info
|
||||||
@ -270,7 +271,7 @@ export default defineComponent({
|
|||||||
default: () => [createStaticVNode(replaced, 1)]
|
default: () => [createStaticVNode(replaced, 1)]
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
} else if (selectiveClient && import.meta.client && canLoadClientComponent.value) {
|
} else if (canLoadClientComponent.value) {
|
||||||
for (const [id, info] of Object.entries(payloads.components ?? {})) {
|
for (const [id, info] of Object.entries(payloads.components ?? {})) {
|
||||||
const { props, slots } = info
|
const { props, slots } = info
|
||||||
const component = components!.get(id)!
|
const component = components!.get(id)!
|
||||||
@ -285,6 +286,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return h(Fragment, teleports)
|
return h(Fragment, teleports)
|
||||||
}, _cache, 1)
|
}, _cache, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user