swc README

The project's README from github.com/swc-project/swc. As one markdown file: README.md.

swc

Make the web (development) faster.

downloads (@swc/core) downloads (3rd party)

undefined GitHub release (latest SemVer)

GitHub code size in bytes node-current (scoped)

Discord

SWC (stands for Speedy Web Compiler) is a super-fast TypeScript / JavaScript compiler written in Rust. It's a library for Rust and JavaScript at the same time. If you are using SWC from Rust, see rustdoc and for most users, your entry point for using the library will be parser.

Also, SWC tries to ensure that

If you select the latest version of each crates, it will work

for rust users.

MSRV of crates is currently 1.73.

To update all SWC crates you use, you can run curl https://raw.githubusercontent.com/swc-project/swc/main/scripts/update-all-swc-crates.sh | bash -s. This script will update all dependencies to the latest version and run cargo build to ensure that everything works. Note that you need

command to run the script.

Supported Node Versions:


If you are using SWC from JavaScript, please refer to docs on the website.

Documentation

Check out the documentation in the website.

Features

Please see comparison with babel.

Performance

Please see benchmark results on the website.

Supporting development

Supporting swc

Star History

Star History Chart

Powered by

JetBrains logo.

Sponsors

Sponsors

SWC is a community-driven project, and is maintained by a group of volunteers. If you'd like to help support the future of the project, please consider:

Contributing

See CONTRIBUTING.md. You may also find the architecture documentation useful (ARCHITECTURE.md).

License

SWC is primarily distributed under the terms of the Apache License (Version 2.0).

See LICENSE for details.

swc (swc-project/swc)

Searching Database…

34.2K ·GitHub
这是什么?SWC(Speedy Web Compiler)是一个用 Rust 编写的超快 TypeScript/JavaScript 编译器——一个面向 Web 的 Rust 平台。
这是一个我要运行的工具,还是一个我要写代码调用的库?其实两者都是:README 把它同时描述为 Rust 和 JavaScript 的库——一边是 Rust crate,另一边是 JavaScript 用法。
我怎么把它引入 Rust 或 JavaScript 项目?取决于语言:用 Rust 的话,文档在 rustdoc 里,parser crate 是常用的入口;用 JavaScript 的话,照着网站上的使用文档操作即可。
我需要哪些 Rust 和 Node 版本?SWC 的 crate 目前要求 Rust 1.73 或更新版本(这就是 MSRV)。Node 方面,使用时支持 v10 及以上,开发时要求 v20 及以上。
它在 Windows 上也能跑吗,就像 macOS 和 Linux 一样?能——这个仓库标记为支持 Linux、macOS 和 Windows,三大桌面平台都覆盖了。
我可以在商业项目里用它吗?可以——SWC 主要以 Apache License, Version 2.0 发布,商用没问题。
它和 Babel 有什么不同?README 里没有直接列出区别,而是指向一个专门与 Babel 对比的页面,以及网站上的基准测试结果。它的核心卖点是速度——一个用 Rust 写的 TS/JS 编译器。
我怎么让我的 SWC crate 保持最新?运行提供的一行命令(curl | bash -s):它会把你在用的每个 SWC crate 都更新到最新版本,并运行 cargo build 确认一切正常。前提是先装好 jq 和 cargo upgrade 命令。
这是一个成熟项目,还是早期的实验品?很成熟:开发始于 2017 年 12 月,仓库在 GitHub 上约有 34k 星标,项目由社区驱动,还有赞助商支持。
What are similar projects?oxc, babel, closure-compiler, rspack, esbuild, less.js, marked, gopherjs
Size
456.5 MB
Stars
34.2K
Age
8y
Commits · 90 Days