Skip to content

Commit ca41a8b

Browse files
authored
spitballing for import-js#17
1 parent 18eafa2 commit ca41a8b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ function resolveFile(source, file, config) {
7474
}
7575

7676
log('didnt find', source);
77-
77+
78+
// naive attempt at @types/* resolution,
79+
// iff path is neither absolute nor relative
80+
if (!path.isAbsolute(source) && source[0] !== ".") {
81+
const definitely = resolveFile("@types/"+source, file, config)
82+
if (definitely.found) {
83+
return definitely
84+
}
85+
}
86+
7887
return {
7988
found: false,
8089
};

0 commit comments

Comments
 (0)