Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

append dirname of tsconfigPath to project reference paths #39

Merged

Conversation

noisyscanner
Copy link
Collaborator

@noisyscanner noisyscanner commented Jan 15, 2021

Closes #38

Copy link
Owner

@azu azu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -52,24 +55,26 @@ export const toProjectReferences = (options: Options) => {
if (!absolutePathOrNull) {
return;
}
if (!path.isAbsolute(absolutePathOrNull)) {
const tsConfigDirName = path.dirname(options.tsConfigPath ?? DEFAULT_TSCONFIGPATH);
const absolutePath = path.join(absolutePathOrNull, tsConfigDirName);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> require("path").dirname("tsconfig.json")
'.'
> require("path").join("a", ".")
'a'

aha. it will work correctly.

@noisyscanner noisyscanner force-pushed the use-tsconfigpath-dir-for-ref-paths branch from ca5e290 to 8bb4f76 Compare January 17, 2021 15:52
@noisyscanner
Copy link
Collaborator Author

Sorted @azu :)

Copy link
Owner

@azu azu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks!

@azu azu merged commit 3968fac into azu:master Jan 18, 2021
@noisyscanner noisyscanner deleted the use-tsconfigpath-dir-for-ref-paths branch January 18, 2021 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to reference sub-directories of referenced projects
2 participants