File tree Expand file tree Collapse file tree 1 file changed +0
-7
lines changed
Expand file tree Collapse file tree 1 file changed +0
-7
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,6 @@ Vite 忽略 `tsconfig.json` 中的 `target` 值,遵循与 `esbuild` 相同的
9191
9292要在开发中指定目标,可使用 [ ` esbuild.target ` ] ( /config/shared-options.html#esbuild ) 选项,默认值为 ` esnext ` ,以实现最小的转译。在构建中,[ ` build.target ` ] ( /config/build-options.html#build-target ) 选项优先于 ` esbuild.target ` ,如有需要也可以进行设置。
9393
94- ::: warning ` useDefineForClassFields `
95-
96- 如果 ` target ` 不是 ` ESNext ` 或 ` ES2022 ` 或更新版本,或者没有 ` tsconfig.json ` 文件,` useDefineForClassFields ` 将默认为 ` false ` ,这可能会导致默认的 ` esbuild.target ` 值为 ` esnext ` 的问题。它可能会转译为 [ static initialization blocks] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks#browser_compatibility ) ,这在你的浏览器中可能不被支持。
97-
98- 因此,建议将 ` target ` 设置为 ` ESNext ` 或 ` ES2022 ` 或更新版本,或者在配置 ` tsconfig.json ` 时将 ` useDefineForClassFields ` 显式设置为 ` true ` 。
99- :::
100-
10194#### ` emitDecoratorMetadata ` {#emitDecoratorMetadata}
10295
10396- [ TypeScript 文档] ( https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata )
You can’t perform that action at this time.
0 commit comments