Skip to content
Home / Migrations / BabelSWC

Babel SWC

easy

SWC is 20-70x faster than Babel for transpilation. Drop-in replacement for most projects. No plugins needed for TypeScript/JSX.

Estimated: 1-2h · 5 steps
Progress0%
Step 1: Install SWC
npm install -D @swc/core @swc/cli && npm uninstall @babel/core @babel/preset-env @babel/preset-typescript @babel/preset-react
Step 2: Create .swcrc

SWC config is simpler than Babel. One file for TypeScript + React.

{
  "jsc": { "parser": { "syntax": "typescript", "tsx": true }, "target": "es2020" },
  "module": { "type": "commonjs" }
}
Step 3: Update build scripts

Replace babel with swc in package.json scripts. Jest: use @swc/jest transform.

npm install -D @swc/jest
Step 4: Check custom Babel plugins

If you used babel-plugin-* beyond basic transforms, check SWC plugin compatibility. Most popular plugins have equivalents.

Step 5: Verify
Build succeeds, tests pass, output is equivalent to Babel

What this migration involves

Moving from Babel to SWC is rated easy and takes about 1-2h on a typical project. The guide breaks it into 5 steps, 3 of which ship with runnable commands and 1 with a verification check.

FAQ

How long does migrating from Babel to SWC take?

Around 1-2h for a typical project — 5 steps, difficulty rated easy, 3 of them with copy-paste commands.

Is moving from Babel to SWC reversible?

No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your Babel data before you start.

What does SWC cost compared to Babel?

Pricing for both tools is contact-based or not tracked yet.