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

resolve from outDir #48190

Closed
wants to merge 1 commit into from
Closed

Conversation

alexeagle
Copy link
Contributor

@alexeagle alexeagle commented Mar 9, 2022

Under the new proposed compilerOptions.resolveFromOutDir boolean,
module resolution is attempted relative to the output folder.

This is analogous to loading from the rootDirs, however it allows
compilation where the output directory is configured on the command line
rather than in the tsconfig.json.

See the attached issue for context.

TODO:

  • figure out what tests to add
  • reason about whether this interacts correctly with other related
    module resolution conditional logic
  • verify this works in some Bazel projects where the problem is observed

Fixes #22208
Fixes #37378

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 9, 2022
Proof of concept for resolving microsoft#37378

Under the new proposed `compilerOptions.resolveFromOutDir` boolean,
module resolution is attempted relative to the output folder.

This is analogous to loading from the rootDirs, however it allows
compilation where the output directory is configured on the command line
rather than in the tsconfig.json.

See the attached issue for context.

TODO:
- figure out what tests to add
- reason about whether this interacts correctly with other related
module resolution conditional logic
- verify this works in some Bazel projects where the problem is observed
@alexeagle alexeagle changed the title hack: resolve from outDir resolve from outDir Mar 10, 2022
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Mar 10, 2022
@alexeagle alexeagle marked this pull request as ready for review March 10, 2022 23:41
gregmagolan pushed a commit to alexeagle/TypeScript that referenced this pull request Mar 17, 2022
Copy link
Member

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

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

I think the suggestion was to compute outDir for the referenced project and not change module resolution.

@alexeagle
Copy link
Contributor Author

Thanks @sheetalkamat I replied on the associated issue about why this design was chosen.

@sandersn
Copy link
Member

Reading through the issue history, it looks like bazel doesn't need this PR anymore. I'm going to close it since I don't think @sheetalkamat 's concerns ever changed.

@alexeagle let me know if we should re-open this.

@sandersn sandersn closed this Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
5 participants