Skip to content

Commit 886209d

Browse files
chengzhuo5JounQin
andcommitted
fix: compatible with true type parserOptions.project (#12)
Co-authored-by: JounQin <[email protected]>
1 parent afb4edb commit 886209d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ExportMap.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ ExportMap.parse = function (path, content, context) {
561561
if (project) {
562562
const projects = Array.isArray(project) ? project : [project];
563563
for (const project of projects) {
564-
tsconfigResult = getTsconfig(pathResolve(tsconfigRootDir, project));
564+
tsconfigResult = getTsconfig(project === true ? context.filename : pathResolve(tsconfigRootDir, project));
565565
if (tsconfigResult) {
566566
break;
567567
}
@@ -800,6 +800,13 @@ function childContext(path, context) {
800800
parserOptions,
801801
parserPath,
802802
path,
803+
filename: typeof context.getPhysicalFilename === 'function'
804+
? context.getPhysicalFilename()
805+
: context.physicalFilename != null
806+
? context.physicalFilename
807+
: typeof context.getFilename === 'function'
808+
? context.getFilename()
809+
: context.filename,
803810
};
804811
}
805812

0 commit comments

Comments
 (0)