docs: clarify tsconfig resolution for each file - #22744
Merged
sapphi-red merged 3 commits intoJun 26, 2026
Merged
Conversation
shulaoda
marked this pull request as ready for review
June 23, 2026 02:01
sapphi-red
reviewed
Jun 25, 2026
Comment on lines
+56
to
+60
| Vite respects some of the options in `tsconfig.json` and sets the corresponding Oxc Transformer options. For each file, Vite uses the closest parent `tsconfig.json` that matches the file: | ||
|
|
||
| - A `tsconfig.json` matches when the file satisfies its [`files`](https://www.typescriptlang.org/tsconfig/#files), [`include`](https://www.typescriptlang.org/tsconfig/#include), and [`exclude`](https://www.typescriptlang.org/tsconfig/#exclude) fields, or those of one of the config files listed in its [`references`](https://www.typescriptlang.org/tsconfig/#references) field. | ||
| - If a `tsconfig.json` doesn't match, Vite keeps searching parent directories upward. | ||
| - If no `tsconfig.json` matches the file, none of these options are applied. |
Member
There was a problem hiding this comment.
Suggested change
| Vite respects some of the options in `tsconfig.json` and sets the corresponding Oxc Transformer options. For each file, Vite uses the closest parent `tsconfig.json` that matches the file: | |
| - A `tsconfig.json` matches when the file satisfies its [`files`](https://www.typescriptlang.org/tsconfig/#files), [`include`](https://www.typescriptlang.org/tsconfig/#include), and [`exclude`](https://www.typescriptlang.org/tsconfig/#exclude) fields, or those of one of the config files listed in its [`references`](https://www.typescriptlang.org/tsconfig/#references) field. | |
| - If a `tsconfig.json` doesn't match, Vite keeps searching parent directories upward. | |
| - If no `tsconfig.json` matches the file, none of these options are applied. | |
| Vite respects some of the options in `tsconfig.json` and sets the corresponding Oxc Transformer options. For each file, Vite uses the closest parent `tsconfig.json` or the config referenced by the [`references`](https://www.typescriptlang.org/tsconfig/#references) field in them if that config matches the file. Vite treats the config to match a file when the file satisfies the config's [`files`](https://www.typescriptlang.org/tsconfig/#files), [`include`](https://www.typescriptlang.org/tsconfig/#include), and [`exclude`](https://www.typescriptlang.org/tsconfig/#exclude) fields. |
I think the last 2 items are already implied in the sentence.
Member
Author
There was a problem hiding this comment.
Agreed on merging into one paragraph and dropping the "no match, no options" part as implied. I'd just keep the wording as the closest parent tsconfig.json that matches the file (relative clause) rather than if that config matches, so the walk-up when it doesn't match isn't lost.
Co-authored-by: 翠 <green@sapphi.red>
sapphi-red
approved these changes
Jun 26, 2026
sapphi-red
deleted the
06-23-docs_clarify_tsconfig_resolution_for_each_file
branch
June 26, 2026 03:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #22695 (upgrade to Rolldown 1.1.2). The old wording "Vite uses the
tsconfig.jsonin the closest parent directory" was inaccurate: Vite walks up the directory tree and uses the closesttsconfig.jsonthat matches the file, not simply the closest one.The docs now state that:
files,include, andexcludefields, or those of one of itsreferences.tsconfig.jsonmatches the file.Docs-only change.
Notes for reviewers
Reference: #22695, Rolldown v1.1.2, and the
tsconfiginput option docs.