Skip to content

Commit

Permalink
barrel file moduleSuffix for type exports
Browse files Browse the repository at this point in the history
  • Loading branch information
leovigna committed Sep 15, 2023
1 parent c8ac1aa commit 49fb575
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/typechain/src/codegen/createBarrelFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export function createBarrelFiles(
.map((p) => {
const namespaceIdentifier = camelCase(p)

if (typeOnly && moduleSuffix)
return [
`import type * as ${namespaceIdentifier} from './${p}/index${moduleSuffix}';`,
`export type { ${namespaceIdentifier} };`,
].join('\n')

if (typeOnly)
return [
`import type * as ${namespaceIdentifier} from './${p}';`,
Expand Down

0 comments on commit 49fb575

Please sign in to comment.