Skip to main content
Add Babel only when you need transforms or plugins that SWC (Speedy Web Compiler) does not cover. Keep SWC as the default pipeline, then scope Babel to the files that need it.

When Babel is a good fit

  • You depend on Babel-only plugins or presets.
  • You are migrating an existing Babel-heavy project incrementally.
  • You want targeted transforms for specific file types (for example, MDX).

Babel capabilities

Example setup

Install Babel dependencies:
Create babel.config.json:
Wire Babel into extension.config.js for MDX only:

Replace SWC for JS/TS only if required

Use this pattern only when you need Babel to process JS/TS entry files directly:

Best practices

  • Prefer targeted Babel usage before replacing the default JS/TS pipeline.
  • Keep Babel rules explicit so loader ordering stays predictable.
  • Reuse Babel only where migration or plugin compatibility requires it.

Next steps