Skip to content

Commit

Permalink
CODEBASE: Use "esnext" target when transforming code with swc (#1810)
Browse files Browse the repository at this point in the history
  • Loading branch information
catloversg authored Dec 1, 2024
1 parent 0caeb5c commit 67704f2
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 63 deletions.
133 changes: 74 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"url": "https://github.com/bitburner-official/bitburner-src/issues"
},
"dependencies": {
"@babel/standalone": "^7.24.4",
"@babel/standalone": "^7.26.2",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@material-ui/core": "^4.12.4",
"@mui/icons-material": "^5.14.12",
"@mui/material": "^5.14.12",
"@mui/styles": "^5.14.12",
"@mui/system": "^5.14.12",
"@swc/wasm-web": "^1.4.14",
"@swc/wasm-web": "^1.9.3",
"@types/estree": "^1.0.2",
"@types/react-syntax-highlighter": "^15.5.8",
"acorn": "^8.11.3",
Expand Down Expand Up @@ -58,7 +58,7 @@
"@microsoft/api-documenter": "~7.23.38",
"@microsoft/api-extractor": "^7.47.5",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@swc/core": "^1.4.14",
"@swc/core": "^1.9.3",
"@types/babel__standalone": "^7.1.7",
"@types/bcryptjs": "^2.4.4",
"@types/escodegen": "^0.0.7",
Expand Down
3 changes: 2 additions & 1 deletion src/utils/ScriptTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 67704f2

Please sign in to comment.