Changelog: swc v1.1.21

Improvements#

Automatic typescript detection (#655)#

As typescript support is embedded in swc by default, swc handles it out of the box.

You don't need any configuration to use typescript. Also note that It also detects tsx and automatically enables tsx for the files whose name ends with .tsx.

Bugfixes#

TypeScript const assertion (#656)#

export const x = { text: "hello" } as const;

is transcompiled as

export const x = { text: "hello" };

cli bugfixes (#658)#

Exclude fields in .swcrc now works correctly.

{
"test": ".*.tsx$",
"exclude": ".*.spec.tsx$",
"jsc": {
"target": "es2018",
"parser": {
"syntax": "typescript",
"tsx": true
}
}
}