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

docs: clarify target in tsconfig.json #18377

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

sapphi-red
Copy link
Member

Description

close #16334

@sapphi-red sapphi-red added the documentation Improvements or additions to documentation label Oct 17, 2024
Copy link

stackblitz bot commented Oct 17, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@@ -88,12 +88,13 @@ But a few libraries haven't transitioned to this new default yet, including [`li

- [TypeScript documentation](https://www.typescriptlang.org/tsconfig#target)

Vite does not transpile TypeScript with the configured `target` value by default, following the same behaviour as `esbuild`.
Vite ignores the `target` value in the `tsconfig.json`, following the same behavior as `esbuild`.
Copy link
Member Author

Choose a reason for hiding this comment

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

Actually target is used to derive the default value of useDefineForClassFields, but I think it's more easy to understand if we say "ignore" here even if it's a bit of lie.

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

Maybe we should add a per environment dev.target (equivalent to build.target) so we start preparing the ground for Rolldown with this defined in Vite's side and not on the esbuild options.

@bluwy
Copy link
Member

bluwy commented Oct 18, 2024

Wouldn't dev.target mean we have to transpile every file by default now? (Including JS)

Maybe we can do that if perf is not an issue anymore for better expectations. Otherwise we have to educate users to use esbuild.target + esbuild.include to get the behaviour they want (which doesn't dismiss the perf aspect still).

@patak-dev
Copy link
Member

Maybe it should be with another name then. I'm thinking more about the need for this value to be under vite's config instead of esbuild if we migrate to Rolldown, or we'll need to tell them at that point to migrate their esbuild config to Rolldown config.

@patak-dev patak-dev merged commit dcf5f03 into vitejs:main Oct 18, 2024
10 checks passed
@sapphi-red sapphi-red deleted the docs/clarify-tsconfig-target branch October 18, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config "build.target" option documentation is confusing
3 participants