Always use target ES2021 (#25170)

This commit is contained in:
Bram Kragten 2025-04-25 11:04:05 +02:00 committed by GitHub
parent 221e1d9ed8
commit 488599905b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View File

@ -74,11 +74,11 @@ module.exports.terserOptions = ({ latestBuild, isTestBuild }) => ({
}); });
/** @type {import('@rspack/core').SwcLoaderOptions} */ /** @type {import('@rspack/core').SwcLoaderOptions} */
module.exports.swcOptions = ({ latestBuild }) => ({ module.exports.swcOptions = () => ({
jsc: { jsc: {
loose: true, loose: true,
externalHelpers: true, externalHelpers: true,
target: latestBuild ? "ES2021" : "ES5", target: "ES2021",
parser: { parser: {
syntax: "typescript", syntax: "typescript",
decorators: true, decorators: true,

View File

@ -82,9 +82,7 @@ const createRspackConfig = ({
}, },
{ {
loader: "builtin:swc-loader", loader: "builtin:swc-loader",
options: bundle.swcOptions({ options: bundle.swcOptions(),
latestBuild,
}),
}, },
], ],
resolve: { resolve: {