diff --git a/package.json b/package.json index 63f01b1a6..3dd938ef4 100644 --- a/package.json +++ b/package.json @@ -148,7 +148,7 @@ "@swc/core": ">=1.3.85", "@swc/wasm": ">=1.3.85", "@types/node": "*", - "typescript": ">=4.4" + "typescript": ">=5.0" }, "peerDependenciesMeta": { "@swc/core": { diff --git a/src/transpilers/swc.ts b/src/transpilers/swc.ts index ea41d534c..cfe25f4b4 100644 --- a/src/transpilers/swc.ts +++ b/src/transpilers/swc.ts @@ -225,14 +225,15 @@ export function createSwcOptions( parser: { syntax: 'typescript', tsx: isTsx, - decorators: experimentalDecorators, + decorators: true, dynamicImport: true, importAssertions: true, } as swcWasm.TsParserConfig, target: swcTarget as swcWasm.JscTarget, transform: { decoratorMetadata: emitDecoratorMetadata, - legacyDecorator: true, + legacyDecorator: experimentalDecorators, + decoratorVersion: experimentalDecorators ? '2021-12' : '2022-03', react: { throwIfNamespace: false, development: jsxDevelopment,