Overview
Use the compiler your framework already ships and add Babel only for plugins that exist nowhere else. SWC (Rust) is the transform inside Next.js; Vite 8 transforms with Oxc by default; Babel 8 (released 2026-06-16, ESM-only, no ES5 target by default) remains the reference plugin host. None of the three type-checks; run tsc separately.
Comparison
| Dimension | SWC | Babel 8 |
|---|---|---|
| Language | Rust | JavaScript |
| Where it is the default | Next.js compiler (since Next.js 12), @swc/jest, @vitejs/plugin-react-swc | Tooling that needs the plugin ecosystem |
| TypeScript and JSX | Built in; strips types without checking | @babel/preset-typescript, @babel/preset-react |
| Plugins | Rust/Wasm plugin API; common transforms built in | Thousands of JavaScript plugins |
| Decorators | legacyDecorator and decoratorMetadata options, plus decoratorVersion | Plugin-based |
| Custom transforms | Write Rust or Wasm | Write a JavaScript visitor |
Pick SWC when
Pick SWC (or the framework’s built-in transform) for application builds and test transforms.
- Next.js: the compiler is built on SWC and the Next.js docs report it as 17 times faster than Babel. A
.babelrcorbabel.config.jsmakes Next.js use Babel for individual files, so delete it unless required. - Jest: replace
babel-jestandts-jestwith@swc/jest. See jest-vs-vitest. - NestJS, TypeORM, and other decorator-metadata code: set
jsc.transform.legacyDecoratoranddecoratorMetadatain.swcrc, then test the entities. - Vite projects:
@vitejs/plugin-react-swcstays available; Vite 8 itself uses Oxc and Rolldown. See vite-vs-webpack.
{
"jsc": {
"parser": { "syntax": "typescript", "tsx": true },
"target": "es2022"
}
}Pick Babel when
Pick Babel when a required plugin has no SWC or Oxc port.
- React Compiler:
babel-plugin-react-compileris a Babel plugin. Next.js 16 supports it behindreactCompiler: true, using an SWC check to limit it to relevant files, and still needs the Babel plugin installed. Vite setups add a Babel plugin step. - Macros (
babel-plugin-macros) and internal AST plugins for i18n extraction or feature flags. - Libraries that publish a Babel plugin as their only integration path.
- Plugins for early-stage (Stage 2 or 3) proposals such as the pipeline operator: check SWC’s plugin list first.
Run Babel alongside a fast transform where possible: let SWC or Oxc handle the bulk and limit Babel to the files that need the plugin.
Migrate from Babel to SWC
Replace presets with one .swcrc, then fix what fails.
- Remove
@babel/coreand presets; add@swc/coreand, for tests,@swc/jest. - Set parser syntax, target, and module type in
.swcrc. - Run the suite. Failures cluster around macros and decorator semantics.
- In Next.js, deleting the Babel config re-enables the SWC path.
FAQ
Is SWC faster than Babel?
Yes; the Next.js docs report the SWC-based compiler as 17 times faster than Babel. Use the transform your framework ships, SWC in Next.js or Oxc in Vite 8.
Do I still need Babel at all?
Only for plugins with no SWC or Oxc port, such as babel-plugin-react-compiler, babel-plugin-macros, and internal AST plugins. Limit Babel to the files that need the plugin.
Does SWC type-check TypeScript?
No; SWC strips types without checking, and neither Babel nor Oxc type-checks either. Run tsc separately.
Why is Next.js using Babel instead of SWC?
A .babelrc or babel.config.js in the project makes Next.js use Babel for individual files. Delete it unless a Babel-only plugin requires it, and the SWC path is re-enabled.