8000 fix: support star exports · nuxt/module-builder@8966047 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 8966047

Browse files
committed
fix: support star exports
1 parent 8e60457 commit 8966047

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/commands/build.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ ${appShims.length ? `declare module '#app' {\n${appShims.join('\n')}\n}\n` : ''}
271271
${schemaShims.length ? `declare module '@nuxt/schema' {\n${schemaShims.join('\n')}\n}\n` : ''}
272272
${moduleExports.length ? `\n${moduleExports.join('\n')}` : ''}
273273
${isStub ? 'export * from "./module.mjs"' : ''}
274-
${moduleReExports.map(e => `\nexport { ${e.names.map(n => (n === 'default' ? '' : 'type ') + n).join(', ')} } from '${e.specifier || './module.mjs'}'`).join('\n')}
274+
${moduleReExports.filter(e => e.type === 'named' || e.type === 'default').map(e => `\nexport { ${e.names.map(n => (n === 'default' ? '' : 'type ') + n).join(', ')} } from '${e.specifier || './module.mjs'}'`).join('\n')}
275+
${moduleReExports.filter(e => e.type === 'star').map(e => `\nexport * from '${e.specifier || './module.mjs'}'`).join('\n')}
275276
`.trim().replace(/[\n\r]{3,}/g, '\n\n') + '\n'
276277

277278
await fsp.writeFile(dtsFile, dtsContents, 'utf8')

0 commit comments

Comments
 (0)
0