Skip to content

Commit b98d261

Browse files
committed
fix: use component export name for stubs compat
1 parent 77082f2 commit b98d261

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/templates.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const componentsManifestTemplate = (manifest: Manifest) => {
139139
const importPath = isAbsolute(c.filePath)
140140
? './' + relative(join(nuxt.options.buildDir, 'content'), c.filePath).replace(/\b\.(?!vue)\w+$/g, '')
141141
: c.filePath.replace(/\b\.(?!vue)\w+$/g, '')
142-
map[c.pascalName] = map[c.pascalName] || [c.pascalName, importPath, c.global]
142+
map[c.pascalName] = map[c.pascalName] || [c.pascalName, importPath, c.global, c.export || 'default']
143143
return map
144144
}, {} as Record<string, unknown[]>)
145145

@@ -148,7 +148,7 @@ export const componentsManifestTemplate = (manifest: Manifest) => {
148148
const localComponents = componentsList.filter(c => !c[2])
149149
return [
150150
// Export local components directly for SSR compatibility (fixes #3700)
151-
...localComponents.map(([pascalName, path]) => `export { default as ${pascalName} } from '${path}'`),
151+
...localComponents.map(([pascalName, path, , exp]) => `export { ${exp} as ${pascalName} } from '${path}'`),
152152
`export const globalComponents: string[] = ${JSON.stringify(globalComponents)}`,
153153
`export const localComponents: string[] = ${JSON.stringify(localComponents.map(c => c[0]))}`,
154154
].join('\n')

0 commit comments

Comments
 (0)