We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdd3541 commit 8f733dcCopy full SHA for 8f733dc
typescript/src/core/post-processors/exports.post-processor.ts
@@ -40,7 +40,13 @@ export class ExportsPostProcessor extends PostProcessor {
40
41
const stats = fs.statSync(modulePathAbsolute);
42
if (stats.isDirectory()) {
43
- modulePathAbsolute += "/index.ts";
+ 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
+ }
50
}
51
const rawExports = this.filterExportsForModule(exports, modulePathAbsolute);
52
0 commit comments