11 ms·
I'd rather not deal with dozens of babel-plugin-*. Can this or esbuild be used instead of babel?
by slig 5y ago
I'd rather not deal with dozens of babel-plugin-*. Can this or esbuild be used instead of babel?
- deleted 5y ago[deleted]
- leerob 5y agoYes. SWC is being used by Next.js to replace Babel. With SWC, compilation is about 17x faster than Babel in v12[1]. We created a CSS parser in Rust (through SWC), as well as ported many of the common Babel plugins to Rust[2]. Work is still ongoing here[3]. [1]: https://nextjs.org/blog/next-12#faster-builds-and-fast-refresh-with-rust-compiler https://nextjs.org/blog/next-12#faster-builds-and-fast-refre... [2]: https://nextjs.org/docs/advanced-features/compiler https://nextjs.org/docs/advanced-features/compiler [3]: https://github.com/vercel/next.js/discussions/30174 https://github.com/vercel/next.js/discussions/30174
- slig 5y agoFantastic, thank you very much!
- machiaweliczny 5y agoThose promises don't seem true in practice. I've tested next 11 vs 12 and got 0 speedup. Maybe because of M1 mac. IDK, would need to dig deeper - anyone had similar case?
- nsonha 5y agocheck the upgrading guide > When an application has a custom Babel configuration, Next.js will automatically opt-out of using SWC if they don't show a warning like they did with webpack 5 then that needs to be improved.
- machiaweliczny 5y agoRemoved babel config. Maybe because I wasn't using babel much (just to transpile for more compatibility).
- leerob 5y ago(I work at Vercel) Happy to take at your application if you want. You can DM me on Twitter: https://twitter.com/leeerob https://twitter.com/leeerob