Skip to content

Commit 25f4f9c

Browse files
authored
fix: follow directory imports (#103)
1 parent f372987 commit 25f4f9c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/shiny-places-greet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'dts-buddy': patch
3+
---
4+
5+
fix: follow directory imports

src/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ export function resolve_dts(from, to) {
506506
if (file.endsWith('.js')) return file.replace(/\.js$/, '.d.ts');
507507
if (file.endsWith('.jsx')) return file.replace(/\.jsx$/, '.d.ts');
508508
if (file.endsWith('.tsx')) return file.replace(/\.tsx$/, '.d.ts');
509+
if (fs.existsSync(file) && fs.statSync(file).isDirectory()) return file + '/index.d.ts';
509510
return file + '.d.ts';
510511
}
511512

0 commit comments

Comments
 (0)