Skip to content

Commit 1f2ed17

Browse files
authored
feat: update esbuild compilation affecting fields (#10374)
1 parent cea3bcf commit 1f2ed17

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

guide/features.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ However, some libraries (e.g. [`vue`](https://github.com/vuejs/core/issues/1228)
5757

5858
#### `useDefineForClassFields`
5959

60-
Starting from Vite 2.5.0, the default value will be `true` if the TypeScript target is `ESNext`. It is consistent with the [behavior of `tsc` 4.3.2 and later](https://github.com/microsoft/TypeScript/pull/42663). It is also the standard ECMAScript runtime behavior.
60+
Starting from Vite 2.5.0, the default value will be `true` if the TypeScript target is `ES2022` or higher including `ESNext`. It is consistent with the [behavior of `tsc` 4.3.2 and later](https://github.com/microsoft/TypeScript/pull/42663). It is also the standard ECMAScript runtime behavior.
6161

6262
But it may be counter-intuitive for those coming from other programming languages or older versions of TypeScript.
6363
You can read more about the transition in the [TypeScript 3.7 release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier).
@@ -71,10 +71,13 @@ But a few libraries haven't transitioned to this new default yet, including [`li
7171
#### Other Compiler Options Affecting the Build Result
7272

7373
- [`extends`](https://www.typescriptlang.org/tsconfig#extends)
74+
- [`alwaysStrict`](https://www.typescriptlang.org/tsconfig#alwaysStrict)
7475
- [`importsNotUsedAsValues`](https://www.typescriptlang.org/tsconfig#importsNotUsedAsValues)
75-
- [`preserveValueImports`](https://www.typescriptlang.org/tsconfig#preserveValueImports)
76+
- [`jsx`](https://www.typescriptlang.org/tsconfig#jsx)
7677
- [`jsxFactory`](https://www.typescriptlang.org/tsconfig#jsxFactory)
7778
- [`jsxFragmentFactory`](https://www.typescriptlang.org/tsconfig#jsxFragmentFactory)
79+
- [`jsxImportSource`](https://www.typescriptlang.org/tsconfig#jsxImportSource)
80+
- [`preserveValueImports`](https://www.typescriptlang.org/tsconfig#preserveValueImports)
7881

7982
If migrating your codebase to `"isolatedModules": true` is an unsurmountable effort, you may be able to get around it with a third-party plugin such as [rollup-plugin-friendly-type-imports](https://www.npmjs.com/package/rollup-plugin-friendly-type-imports). However, this approach is not officially supported by Vite.
8083

0 commit comments

Comments
 (0)