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

DimensionSWCBabel 8
LanguageRustJavaScript
Where it is the defaultNext.js compiler (since Next.js 12), @swc/jest, @vitejs/plugin-react-swcTooling that needs the plugin ecosystem
TypeScript and JSXBuilt in; strips types without checking@babel/preset-typescript, @babel/preset-react
PluginsRust/Wasm plugin API; common transforms built inThousands of JavaScript plugins
DecoratorslegacyDecorator and decoratorMetadata options, plus decoratorVersionPlugin-based
Custom transformsWrite Rust or WasmWrite 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 .babelrc or babel.config.js makes Next.js use Babel for individual files, so delete it unless required.
  • Jest: replace babel-jest and ts-jest with @swc/jest. See jest-vs-vitest.
  • NestJS, TypeORM, and other decorator-metadata code: set jsc.transform.legacyDecorator and decoratorMetadata in .swcrc, then test the entities.
  • Vite projects: @vitejs/plugin-react-swc stays 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-compiler is a Babel plugin. Next.js 16 supports it behind reactCompiler: 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/core and presets; add @swc/core and, 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.