Skip to content

Commit 561eafd

Browse files
authored
docs: remove useDefineForClassFields static init blocks warning (#21181)
1 parent 9d1e98c commit 561eafd

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

guide/features.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@ Vite ignores the `target` value in the `tsconfig.json`, following the same behav
9191

9292
To specify the target in dev, the [`esbuild.target`](/config/shared-options.html#esbuild) option can be used, which defaults to `esnext` for minimal transpilation. In builds, the [`build.target`](/config/build-options.html#build-target) option takes higher priority over `esbuild.target` and can also be set if needed.
9393

94-
::: warning `useDefineForClassFields`
95-
96-
If `target` in `tsconfig.json` is not `ESNext` or `ES2022` or newer, or if there's no `tsconfig.json` file, `useDefineForClassFields` will default to `false` which can be problematic with the default `esbuild.target` value of `esnext`. It may transpile to [static initialization blocks](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks#browser_compatibility) which may not be supported in your browser.
97-
98-
As such, it is recommended to set `target` to `ESNext` or `ES2022` or newer, or set `useDefineForClassFields` to `true` explicitly when configuring `tsconfig.json`.
99-
:::
100-
10194
#### `emitDecoratorMetadata`
10295

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

0 commit comments

Comments
 (0)