diff --git a/packages/typechain/src/codegen/createBarrelFiles.ts b/packages/typechain/src/codegen/createBarrelFiles.ts index 2c4b0f85..2a29dbe2 100644 --- a/packages/typechain/src/codegen/createBarrelFiles.ts +++ b/packages/typechain/src/codegen/createBarrelFiles.ts @@ -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}';`,