-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconsider about using swc as JS/TS transformer #788
Comments
As a side note, swc supports some typescript specific features like Also, starting from v1.2.23, which will be released within a week, swc will support |
I instead think we should stick with Esbuild, after it becomes more mature we could even replace rollup with esbuild in the final bundle step and have much faster builds However you should be able to make a new plugin that uses swc to compile your ts and jsx files if you want |
It's worth considering but esbuild is working just fine so the advantage must be somewhat significant to warrant a major refactor.
More importantly, esbuild is also a bundler so that provides potential cases where we can use esbuild in place of rollup (e.g. pre-optimizing deps). Overall I don't consider it convincing enough to switch. |
FWIW esbuild has already supported this for a long time (since July, so before the original post). |
you can write a simple plugin if you really want to use swc for ts transform. |
In early days, the performance of
swc
is much worse thanesbuild
(around 2 ~ 5x slower).But recently, the author of
swc
landed many performance enhancements inswc
project.Now the performance of
transform
API is very close between@swc/core
andesbuild
: transform parallel benchmark resultsBesides,
swc
have some advantages overesbuild
:experimentalDecorators
in TypeScript.Support@jsx pragma
.transform plugin
top on it jest-hoist-plugin.swc
(They are usingswc
in --no-type-check mode)./cc @yyx990803 @kdy1
The text was updated successfully, but these errors were encountered: