Skip to content

Commit 0c928aa

Browse files
authored
refactor: esbuild handles target and useDefineForClassFields (#7698)
1 parent 66b6dc5 commit 0c928aa

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

packages/vite/src/node/plugins/esbuild.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export async function transformWithEsbuild(
8181
// these fields would affect the compilation result
8282
// https://esbuild.github.io/content-types/#tsconfig-json
8383
const meaningfulFields: Array<keyof TSCompilerOptions> = [
84+
'target',
8485
'jsxFactory',
8586
'jsxFragmentFactory',
8687
'useDefineForClassFields',
@@ -98,17 +99,9 @@ export async function transformWithEsbuild(
9899
compilerOptionsForFile[field] = loadedCompilerOptions[field]
99100
}
100101
}
101-
102-
// align with TypeScript 4.3
103-
// https://github.com/microsoft/TypeScript/pull/42663
104-
if (loadedCompilerOptions.target?.toLowerCase() === 'esnext') {
105-
compilerOptionsForFile.useDefineForClassFields =
106-
loadedCompilerOptions.useDefineForClassFields ?? true
107-
}
108102
}
109103

110104
tsconfigRaw = {
111-
...tsconfigRaw,
112105
compilerOptions: {
113106
...compilerOptionsForFile,
114107
...tsconfigRaw?.compilerOptions

0 commit comments

Comments
 (0)