CODEBASE: Use "esnext" target when transforming code with swc (#1810)

This commit is contained in:
catloversg
2024-12-01 07:02:32 +07:00
committed by GitHub
parent 0caeb5c5ca
commit 67704f2ab0
3 changed files with 79 additions and 63 deletions
+2 -1
View File
@@ -152,7 +152,8 @@ export function transformScript(code: string, fileType: FileType): string | null
return transformSync(code, {
jsc: {
parser: parserConfig,
target: "es2020",
// @ts-expect-error -- jsc supports "esnext" target, but the definition in wasm-web.d.ts is outdated. Ref: https://github.com/swc-project/swc/issues/9495
target: "esnext",
},
}).code;
}