File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
packages/vite/src/node/plugins
playground/tsconfig-json/__tests__ Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -195,12 +195,12 @@ export async function transformWithOxc(
195
195
resolvedOptions . assumptions . setPublicClassFields =
196
196
! useDefineForClassFields
197
197
198
- // set target to es2022 or lower to enable class property transforms
198
+ // set target to es2021 or lower to enable class property transforms
199
199
// https://github.com/oxc-project/oxc/issues/6735#issuecomment-2513866362
200
200
if ( ! useDefineForClassFields ) {
201
201
let set = false
202
202
if ( ! resolvedOptions . target ) {
203
- resolvedOptions . target = 'es2022 '
203
+ resolvedOptions . target = 'es2021 '
204
204
set = true
205
205
} else {
206
206
const target = Array . isArray ( resolvedOptions . target )
@@ -213,21 +213,21 @@ export async function transformWithOxc(
213
213
const esTargetTrimmed = target [ esTargetIndex ] . toLowerCase ( ) . slice ( 2 )
214
214
if (
215
215
esTargetTrimmed === 'next' ||
216
- parseInt ( esTargetTrimmed , 10 ) > 2022
216
+ parseInt ( esTargetTrimmed , 10 ) > 2021
217
217
) {
218
- target [ esTargetIndex ] = 'es2022 '
218
+ target [ esTargetIndex ] = 'es2021 '
219
219
set = true
220
220
}
221
221
} else {
222
- target . push ( 'es2022 ' )
222
+ target . push ( 'es2021 ' )
223
223
set = true
224
224
}
225
225
resolvedOptions . target = target
226
226
}
227
227
228
228
if ( set ) {
229
229
warnings . push (
230
- 'target was modified to include ES2022 ' +
230
+ 'target was modified to include ES2021 ' +
231
231
' because useDefineForClassFields is set to false' +
232
232
' and oxc does not support transforming useDefineForClassFields=false for ES2022+ yet' ,
233
233
)
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { transformWithEsbuild } from 'vite'
4
4
import { describe , expect , test } from 'vitest'
5
5
import { browserLogs , isServe , serverLogs } from '~utils'
6
6
7
- test . skip ( 'should respected each `tsconfig.json`s compilerOptions' , ( ) => {
7
+ test ( 'should respected each `tsconfig.json`s compilerOptions' , ( ) => {
8
8
// main side effect should be called (because of `"verbatimModuleSyntax": true`)
9
9
expect ( browserLogs ) . toContain ( 'main side effect' )
10
10
// main base setter should not be called (because of `"useDefineForClassFields": true"`)
You can’t perform that action at this time.
0 commit comments