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

--target=esnext --tsconfig-raw='{"compilerOptions": { "target": "es2021" }}' will default useDefineForClassFields to true #2584

Closed
sapphi-red opened this issue Sep 30, 2022 · 0 comments

Comments

@sapphi-red
Copy link
Contributor

class A {
  foo = 'string'
}

When transforming the code above with --target=esnext --tsconfig-raw='{"compilerOptions": { "target": "es2021" }}', the output is:

class A {
  foo = "string";
}

This output is the same with the one with useDefineForClassFields: true.

esbuild repl

So I guess useDefineForClassFields's value is derived from target and not from compilerOptions.target.
Is this inteded? I think it makes sense whether the value is derived from A or B.

refs vitejs/vite#10296

@sapphi-red sapphi-red changed the title --target=esnext --tsconfig-raw='{"compilerOptions": { "target": "es2021" }}' will default useDefineForClassFields to true since 0.15.8 --target=esnext --tsconfig-raw='{"compilerOptions": { "target": "es2021" }}' will default useDefineForClassFields to true Sep 30, 2022
@evanw evanw added the tsconfig label Dec 4, 2022
@evanw evanw added the classes label Apr 3, 2023
@evanw evanw closed this as completed in 9be7875 May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants