Changelog: swc v1.2.50
#
Bugfixes#1421)#
TypeScript metadata for unions (Now swc emits proper metadata for union of string literals, like in codes like
Previously, the code printed undefined
when compiled with swc which is wrong.
It is now String
.
use strict
(#1423)#
No duplicated For code like
swc now emits
In previous versions, the 'use strict'
directive was emitted twice.
\r\n
in template literals (#1450)#
Previously swc miscompiled the code below.
\r\n
in template literals was previously parsed as \n
, but it's now parsed as \r\n
.
#1427)#
bundler: Many improvements (The bundler of the swc can now handle much more codes. Various bugs are reported via deno and those are all fixed.
#1279)#
New option to prserve class name (To bypass restrictions of rust, swc uses a trick named span hygiene
.
It modifies identifier at the end to prevent conflict between identifiers.
But this operation can be problematic if the name of class matters.
For example,
depends on the class name.
swc now has an option to preserve class name. See the documentation for .swcrc.
#1415)#
Fix for switch statements in loops (When targeting es3
or es5
, swc broke some codes with switch statements in for loops like
It is now fixed.
#
New features.swcrc
option to enable sourcemps. (#1309)#
Previously generating sourcemap required calling apis with proper option. But now swc has an option to enable sourcemap. See the documentation for .swcrc.
#1439)#
@babel/preset-modules (Thanks to @devongovett, swc now has an option to enable bugfix transforms, just like preset-modules
of babel.
bugfix/transform-async-arrows-in-class
, bugfix/transform-edge-default-parameters
and bugfix/transform-tagged-template-caching
is added.