Skip to content

Commit

Permalink
fix: compatible with true type parserOptions.project (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: JounQin <[email protected]>
  • Loading branch information
chengzhuo5 and JounQin committed Dec 5, 2023
1 parent 2f77695 commit 8a719ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ExportMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ ExportMap.parse = function (path, content, context) {
if (project) {
const projects = Array.isArray(project) ? project : [project];
for (const project of projects) {
tsconfigResult = getTsconfig(pathResolve(tsconfigRootDir, project));
tsconfigResult = getTsconfig(project === true ? context.filename : pathResolve(tsconfigRootDir, project));
if (tsconfigResult) {
break;
}
Expand Down Expand Up @@ -800,6 +800,13 @@ function childContext(path, context) {
parserOptions,
parserPath,
path,
filename: typeof context.getPhysicalFilename === 'function'
? context.getPhysicalFilename()
: context.physicalFilename != null
? context.physicalFilename
: typeof context.getFilename === 'function'
? context.getFilename()
: context.filename,
};
}

Expand Down

0 comments on commit 8a719ad

Please sign in to comment.