12k
All articles

Do You Still Need Babel in 2026?

See whether Babel still runs in your project, what changes in Babel 8, how to upgrade safely, and when SWC, esbuild or Oxc can replace it.

OpenReplay Team
OpenReplay Team
Do You Still Need Babel in 2026?

Most developers no longer configure Babel themselves, but Babel often still runs in their projects because a test runner, a mobile bundler or a framework fallback calls it for them.

You open a pull request from your dependency bot titled “bump @babel/core to 8” in a project where you can’t remember ever writing a Babel config. Before you merge it or ignore it, you need to know who owns Babel in that repository.

This article covers how to find Babel in your dependency tree, what Babel 8 breaks, how to upgrade if you have to, and how SWC, esbuild and Oxc divide up the work that Babel used to do alone.

Key Takeaways

  • Babel 8.0.0 shipped on 16 June 2026 with no new features over Babel 7. It ships as ESM only and no longer compiles to ES5 or CommonJS by default.
  • Run npm ls @babel/core to see whether you configure Babel yourself or whether a tool such as babel-jest or React Native’s Metro transformer pulls it in.
  • In Babel 8, @babel/preset-env without targets compiles for the Browserslist defaults query, so projects that still support legacy browsers must declare targets before upgrading.
  • Next.js compiles with SWC unless it finds a Babel config, and Vite 8 with @vitejs/plugin-react v6 does not depend on Babel at all.
  • Babel 7 plugins have no official support on @babel/core 8, so audit every third-party plugin before upgrading.

Who Still Runs Babel for You?

Next.js and Vite 8 no longer run Babel by default, but Jest, React Native’s Metro bundler and older versions of Vite’s React plugin still do. The Next.js compiler is built in Rust on SWC, but Next.js falls back to Babel when it finds a Babel config in the project or when you rely on a feature the compiler doesn’t support. In the Vite 8 release, @vitejs/plugin-react v6 switched its React Refresh transform to Oxc and dropped Babel from its dependencies, which also shrinks the install.

Babel is still present elsewhere:

  • Jest: babel-jest installs with Jest and transforms your files automatically whenever a Babel config exists.
  • React Native: Metro’s transformer, @react-native/metro-babel-transformer, applies @react-native/babel-preset when it transforms source files during bundling.
  • Vite with @vitejs/plugin-react v5 or earlier: older versions of the plugin still bring in Babel.

How Do You Check Whether Babel Is in Your Project?

Babel is in your stack if any installed package depends on @babel/core. Your package manager can show you which top-level dependency brought it in:

# npm: print every path to @babel/core
npm ls @babel/core

# pnpm
pnpm why @babel/core

# Yarn
yarn why @babel/core

# Do you have your own config?
ls babel.config.* .babelrc* 2>/dev/null
node -e "console.log(require('./package.json').babel ?? 'no babel key')"

npm ls prints a tree. Each top-level entry is a direct dependency, and @babel/core sits somewhere beneath it. If the path goes through jest, @react-native/* or an older @vitejs/plugin-react, then that tool owns Babel, and you should wait for its maintainers to support Babel 8 instead of bumping @babel/core yourself. If the tree is empty and none of the config files exist, Babel 8 doesn’t affect you.

What Changed in Babel 8?

Babel 8.0.0, released on 16 June 2026, modernises Babel’s internals and changes its defaults: it ships as ESM only, requires a newer Node.js, and no longer compiles to ES5 by default. According to the release announcement, 8.0.0 added no new features compared with Babel 7. The same post puts Babel’s weekly downloads at 1.7 million in 2018 and 651 million in June 2026. Features returned with 8.1.0, released on 2 November 2026, which added bytes and text imports, source map range mappings, and ESLint configs.

The main changes:

  • ESM only. Babel’s packages ship as ES modules. CommonJS callers keep working because require(esm) support is now available in all LTS versions of Node.js.
  • Node.js ^22.18.0 || >=24.11.0. The migration guide sets this range for every package. It applies only to the machine that runs Babel, not to the code Babel outputs.
  • New default targets. If you set no targets, preset-env compiles for the Browserslist defaults query, which was roughly ES2023 when Babel 8 was released and will move as browser usage changes. @babel/preset-env also compiles to ESM by default rather than CommonJS.
  • Smaller output. With modern targets, Babel downlevels fewer syntax features, so it emits fewer helpers and transforms.
  • Built-in types. TypeScript types are now available for all Babel packages, so you no longer need the @types/babel__* packages.

Babel 7 stopped receiving backported bug fixes and new features once Babel 8 shipped, but the release announcement promises security support for one year, until June 2027.

Upgrading to Babel 8

The safest way to upgrade is to make each change on Babel 7 first, where the new options already work, and then bump the major version. The migration guide does not include a general-purpose codemod, so you migrate the config by hand:

  1. Set targets (or add a .browserslistrc) if you need ES5 output. Otherwise your build silently switches to modern syntax.
  2. Replace loose/spec with assumptions. They have been supported since Babel 7.13.0.
  3. Switch polyfills. Babel 8 removes the corejs/useBuiltIns options from @babel/plugin-transform-runtime and @babel/preset-env in favour of babel-plugin-polyfill-corejs3, which lives in the babel-polyfills repo.
  4. Rename proposal plugins. @babel/plugin-proposal-* packages are now @babel/plugin-transform-*. The migration guide notes that the rename happened in Babel 7.22, so the new names already work on Babel 7.22 and later.
  5. Set the React runtime. @babel/preset-react now defaults to the automatic JSX runtime. Set runtime: "classic" if your code depends on React.createElement.
  6. Audit plugins. Babel 7 plugins have no official support on @babel/core 8, so check every third-party plugin for a Babel 8 release.

Here is a typical Babel 7 config:

{
  "presets": [
    ["@babel/preset-env", { "loose": true, "useBuiltIns": "usage", "corejs": 3 }],
    "@babel/preset-react"
  ],
  "plugins": ["@babel/plugin-proposal-class-properties"]
}

And the same setup for Babel 8:

{
  "targets": "defaults",
  "assumptions": { "setPublicClassFields": true },
  "presets": [
    "@babel/preset-env",
    ["@babel/preset-react", { "runtime": "automatic" }]
  ],
  "plugins": [
    "@babel/plugin-transform-class-properties",
    ["babel-plugin-polyfill-corejs3", { "method": "usage-global", "version": "3.42.0" }]
  ]
}

The example shows a single assumption. Copy the full set that matches your old loose behaviour from the assumptions docs. Set version to the core-js version you have installed.

Some changes only show up in production builds. preset-react’s development option now follows Babel’s environment, so set NODE_ENV or BABEL_ENV explicitly:

NODE_ENV=production npx babel src --out-dir dist

Also note that preset-typescript now preserves uninitialised class fields, and @babel/eslint-parser requires ESLint 9 or later. Jest users should hold off: reports in Jest’s issue tracker show babel-jest setups that still break with @babel/core 8.

How Do SWC, esbuild and Oxc Compare?

SWC, esbuild and Oxc handle TypeScript and JSX compilation for most projects, and each one sits in a different part of the toolchain:

ToolRoleWhere it runs
SWCRust compiler and minifier; plugins compile to WasmNext.js compiler
esbuildGo bundler with a built-in transformerStandalone builds and libraries; used by Vite before version 8
OxcRust parser, transformer, linter and minifierVite 8, through Rolldown

In Vite 8, Vite uses Rolldown as its bundler, replacing the previous combination of esbuild and Rollup, and Rolldown uses Oxc for parsing and transforms. None of these three tools does type checking, so you still run tsc --noEmit in CI.

When Babel Is Still the Right Tool

Babel is still the right choice when you need a transform that you can write, read and debug in JavaScript. That applies in four cases:

  • Custom plugins. Babel plugins are plain JavaScript visitors. SWC plugins have to be written in Rust and compiled to Wasm.
  • Codemods and AST tooling. @babel/parser, @babel/traverse and @babel/generator are still the standard toolkit for scripted refactors.
  • Early TC39 proposals. Babel is usually the first place a new proposal can be tried.
  • Transforms with no native port. The React Compiler is the clearest example: the React Compiler runs through a Babel plugin, and on Vite 8 you add it back through @rolldown/plugin-babel.

Start with npm ls @babel/core. If the output is empty, you can skip Babel 8 entirely. If a tool such as Jest or React Native pulls Babel in, wait for that tool to support Babel 8. If the config is yours, make the changes on Babel 7 first, audit your plugins, and then upgrade.

FAQs

What replaces useBuiltIns 'entry' and the transform-runtime corejs option in Babel 8?

babel-plugin-polyfill-corejs3 covers all three old setups through its method option. Use 'entry-global' where you had useBuiltIns 'entry', 'usage-global' for useBuiltIns 'usage', and 'usage-pure' for @babel/plugin-transform-runtime with corejs 3. The global methods use core-js. usage-pure imports polyfills from core-js-pure as normal functions and leaves the global scope alone, which suits libraries. The plugin also works on Babel 7.

Does Babel type-check TypeScript code?

No. @babel/preset-typescript strips type annotations and compiles the JavaScript that remains, but it never reports type errors, so code with type errors still builds. SWC, esbuild and Oxc work the same way. Run type checking as a separate step, for example tsc --noEmit in CI or a pre-commit hook, and let Babel or another transformer produce the build output.

Why does my own Babel plugin throw a version error on @babel/core 8?

Plugins built with @babel/helper-plugin-utils usually call api.assertVersion(7). Babel treats a bare number as a range covering that major version only, so the check fails when @babel/core 8 loads the plugin. Once you have tested the plugin on Babel 8, pass a semver range such as '^7.0.0 || ^8.0.0'. Babel also publishes a separate API migration guide for plugin authors.

DevTools for the frontend

Gain Debugging Superpowers

Unleash the power of session replay to reproduce bugs, track slowdowns and uncover frustrations in your app. Get complete visibility into your frontend with OpenReplay — the most advanced open-source session replay tool for developers.

Star on GitHub12k

We use cookies to improve your experience. By using our site, you accept cookies.