Shorten TypeScript and JavaScript compilation times
If you want to reduce the wait time when transforming code, this tool processes that step quickly. SWC is a compiler written in Rust that can be used as a library in both Rust and JavaScript environments. Selecting the latest version of each crate ensures they are designed to work together, reducing concerns about dependency management.
A single library connecting Rust and JavaScript
SWC is Rust-based but provides a direct entry point for JavaScript developers. Rust users should refer to rustdoc, while most users start with the parser. The tool aims to make web development environments faster, and functional differences can be checked through comparison materials with Babel. Specific performance figures or benchmark results are provided on the official website, as the README does not specify direct numerical comparisons.
Crate updates and native package support
Rust users can update all their SWC crates to the latest versions by running a specific script. This process requires the jq and cargo upgrade commands to be installed, and after updating, you should run cargo build to verify it works correctly. In JavaScript environments, the native npm package uses self-loading compressed addons for x64 and arm64 architectures on macOS, Windows MSVC, and Linux GNU/musl. A verified original addon is created on the first load, and the package name and JavaScript API remain the same.
Environment requirements to check before use
Before adopting this tool, you must check the version requirements of your development environment. The minimum supported version (MSRV) for Rust crates is currently 1.73, and Node.js v10 or higher is required for JavaScript usage. Node.js v20 or higher is recommended for development purposes. It is also important to understand the settings related to the native addon cache, such as SWC_NATIVE_BINDING_CACHE, and the boundaries of support. This project is distributed under the Apache License (Version 2.0) and is maintained by a community-based group of volunteers.