Skip to content

Commit 8f733dc

Browse files
extended export resolution
1 parent cdd3541 commit 8f733dc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

typescript/src/core/post-processors/exports.post-processor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ export class ExportsPostProcessor extends PostProcessor {
4040

4141
const stats = fs.statSync(modulePathAbsolute);
4242
if (stats.isDirectory()) {
43-
modulePathAbsolute += "/index.ts";
43+
if (fs.existsSync(modulePathAbsolute + "/index.ts")) {
44+
modulePathAbsolute += "/index.ts";
45+
} else if (fs.existsSync(modulePathAbsolute + "/index.tsx")) {
46+
modulePathAbsolute += "/index.tsx";
47+
} else if (fs.existsSync(modulePathAbsolute + "/index.mts")) {
48+
modulePathAbsolute += "/index.mts";
49+
}
4450
}
4551
const rawExports = this.filterExportsForModule(exports, modulePathAbsolute);
4652

0 commit comments

Comments
 (0)