Skip to content

Update the path in d.ts file if declaration dir/outDir is set in project with project references#27165

Closed
sheetalkamat wants to merge 2 commits intomasterfrom
moduleResolutionWithOutDir
Closed

Update the path in d.ts file if declaration dir/outDir is set in project with project references#27165
sheetalkamat wants to merge 2 commits intomasterfrom
moduleResolutionWithOutDir

Conversation

@sheetalkamat
Copy link
Copy Markdown
Member

Fixes #26036

@weswigham
Copy link
Copy Markdown
Member

weswigham commented Sep 17, 2018

I don't think this isn't a change we should make, and the reporting user is somewhat wrong here by our typical philosophy. We don't rewrite paths in .d.ts emit (beyond making them root-relative in bundle emit) - what's incorrect was referring to the input src folder at all. declarationDir and outDir have never played well with relative imports to files not in the emit, and project reference files aren't special in this regard. Our candidate advice in these cases has always been to use relative imports only for things actually within your current unit of compilation, or to ensure that your output file structure closely mirrors your input file structure, because we won't rewrite the paths for you.

@weswigham
Copy link
Copy Markdown
Member

See #18972 #18951 and #16640. I don't think references meaningfully changes anything here from paths or outDir before it.

@sheetalkamat
Copy link
Copy Markdown
Member Author

@weswigham thank you. Will update the resolution part instead then.

@sheetalkamat sheetalkamat deleted the moduleResolutionWithOutDir branch September 17, 2018 23:43
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants