I Finally Looked Into SWC vs Babel — Here's What I Found


Here’s what I found after going down the rabbit hole.
What’s a Transpiler, Again?
Both Babel and SWC are transpilers, they convert code from one version of a language to another. For JavaScript, that means turning modern syntax (like async/await
, optional chaining, etc.) into code that older browsers can run.
This lets us write future-facing code today, without worrying about backward compatibility.
SWC: Speedy Web Compiler
SWC stands for Speedy Web Compiler, and it lives up to the name. It’s written in Rust, a systems language famous for being fast and memory-safe.
Here’s what SWC claims:
~20x faster than Babel (single-threaded)
~70x faster with 4 cores
For tools like Next.js, Vite, or anything with long build chains, this performance difference is a big deal.
So Why Isn’t Everyone Using SWC?
That’s what I wondered too. After reading through GitHub issues, blog posts, and developer threads, here are some trade-offs I discovered:
No Support for babel-plugin-macros
If you rely on babel-plugin-macros
, you’re out of luck SWC doesn’t support macros at all. There’s no equivalent feature in Rust, and the workarounds are clunky:
Precompile parts of your code using Babel (messy)
Rewrite macros as SWC transforms (not practical for most)
Edge Cases Can Break
SWC prioritizes speed over comprehensive edge case handling. This can lead to subtle differences in behavior compared to Babel, especially with:
Complex class
super()
callsGenerator functions +
yield
quirksSupport for very old JavaScript environments
These issues are rare but if you’re maintaining a large or legacy codebase, it can be risky.
React Compiler Still Uses Babel
If you’re using React Compiler, you’ll need Babel. The official plugin is babel-plugin-react-compiler
, and there’s no SWC support for it (yet).
So depending on your stack, Babel might still be a hard requirement.
When SWC Makes Sense
If you’re:
Starting a new project
Using modern tooling (like Vite, Turbopack, or Next.js)
Not relying on complex Babel plugins/macros
Then SWC is 100% worth trying. You’ll likely get faster builds, snappier feedback loops, and a leaner toolchain.
My Takeaway
I’m glad I finally looked into SWC. It’s fast, impressive, and gaining momentum, and I’ll probably use it in my next side project. But for more complex setups, Babel still holds its ground.
Have you tried switching to SWC? Did it go smoothly, or did you run into edge cases?
I’d love to hear your experience. Let’s figure this out together.
Thanks for reading!
Sources:
https://swc.rs/blog/perf-swc-vs-babel
https://www.reddit.com/r/webdev/comments/1aw4ehx/what_are_the_drawbacks_of_using_swc_instead_of/
https://github.com/swc-project/swc/discussions/4768
Subscribe to my newsletter
Read articles from Akash S G directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
