mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-28 16:42:04 +00:00
fix(nuxt): use pascal name when loading server component (#27928)
This commit is contained in:
parent
e1110493e2
commit
ed7a14aecc
@ -58,7 +58,7 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
|
|||||||
!components.some(c => c.pascalName === component.pascalName && c.mode === 'client')
|
!components.some(c => c.pascalName === component.pascalName && c.mode === 'client')
|
||||||
if (isServerOnly) {
|
if (isServerOnly) {
|
||||||
imports.add(genImport(serverComponentRuntime, [{ name: 'createServerComponent' }]))
|
imports.add(genImport(serverComponentRuntime, [{ name: 'createServerComponent' }]))
|
||||||
imports.add(`const ${identifier} = createServerComponent(${JSON.stringify(name)})`)
|
imports.add(`const ${identifier} = createServerComponent(${JSON.stringify(component.pascalName)})`)
|
||||||
if (!options.experimentalComponentIslands) {
|
if (!options.experimentalComponentIslands) {
|
||||||
logger.warn(`Standalone server components (\`${name}\`) are not yet supported without enabling \`experimental.componentIslands\`.`)
|
logger.warn(`Standalone server components (\`${name}\`) are not yet supported without enabling \`experimental.componentIslands\`.`)
|
||||||
}
|
}
|
||||||
|
2
test/fixtures/basic/pages/islands.vue
vendored
2
test/fixtures/basic/pages/islands.vue
vendored
@ -109,7 +109,7 @@ const count = ref(0)
|
|||||||
</NuxtIsland>
|
</NuxtIsland>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ServerWithClient />
|
<server-with-client />
|
||||||
<ServerWithNestedClient />
|
<ServerWithNestedClient />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user