SWC: Rust-based JavaScript and TypeScript Compiler and Bundler

SWC: Rust-based JavaScript and TypeScript Compiler and Bundler

SWC is a fast and efficient compiler and bundler written in Rust. SWC can be used for minification, bundling, compiling and more. It is similar to Babel but faster and more efficient. According to its website, SWC is 20x faster than babel.

SWC is used by tools such as Turbopack, Vercel's JavaScript/TypeScript bundler/build tool.

Usage

As a normal dev, you do not use it directly. But you can use it in your projects with Vite. For using SWC in a React project, run:

npm create vite@latest

Choose a name for your project, select React, and then select JavaScript + SWC or TypeScript + SWC for variant. Vite will scaffold your project with SWC. This feature is available on Vite 4.