rsnext/errors/swc-disabled.md
Tim Neutkens 08a7f7f31a
Enable SWC by default when there is no custom Babel config (#29811)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
Co-authored-by: padmaia <padmaia@users.noreply.github.com>
2021-10-23 10:21:44 +02:00

17 lines
1.2 KiB
Markdown

# SWC disabled
#### Why This Message Occurred
Next.js now uses Rust-based compiler [SWC](https://swc.rs/) to compile JavaScript/TypeScript. This new compiler is up to 17x faster than Babel when compiling individual files and up to 5x faster Fast Refresh.
Next.js provides full backwards compatibility with applications that have [custom Babel configuration](https://nextjs.org/docs/advanced-features/customizing-babel-config). All transformations that Next.js handles by default like styled-jsx and tree-shaking of `getStaticProps` / `getStaticPaths` / `getServerSideProps` have been ported to Rust.
When an application has custom Babel configuration Next.js will automatically opt-out of using SWC for compiling JavaScript/Typescript and will fall back to using Babel in the same way that it was used in Next.js 11.
Many of the integrations with external libraries that currently require custom Babel transformations will be ported to Rust-based SWC transforms in the near future. These include but are not limited to:
- Styled Components
- Emotion
- Relay
In order to prioritize transforms that will help you adopt SWC please provide your `.babelrc` on [the feedback thread](https://github.com/vercel/next.js/discussions/30174).