Total Pageviews

Thursday, 28 April 2022

SWC


Rust-based platform for the Web

SWC is an extensible Rust-based platform for the next generation of fast developer tools. It's used by tools like Next.js, Parcel, and Deno, as well as companies like Vercel, ByteDance, Tencent, Shopify, and more.

SWC can be used for both compilation and bundling. For compilation, it takes JavaScript / TypeScript files using modern JavaScript features and outputs valid code that is supported by all major browsers.

🏎

SWC is 20x faster than Babel on a single thread and 70x faster on four cores.


Overview

# Download prebuilt binaries
npm i -D @swc/cli @swc/core

# Transpile JavaScript file and emit to stdout
npx swc ./file.js

SWC can be downloaded and used as a pre-built binary, or built from source. Currently, the following binaries are provided:

  • Mac (Apple Silicon)
  • Mac (x64)
  • Linux (x86_64)
  • Linux (aarch64)
  • Linux (armv7)
  • Alpine Linux (also install @swc/core-linux-musl)
  • Android (aarch64)
  • Windows (win32-x64)
  • Windows (ia32)

Features

SWC is designed to be extensible. Currently, there is support for:

  • Compilation
  • Bundling (swcpack)
  • Minification
  • Transforming with WebAssembly
  • Usage inside webpack (swc-loader)
  • Improving Jest performance (@swc/jest)
  • Custom Plugins

from  https://swc.rs/
---------

Getting Started

Installation

The easiest way to try SWC is using the Playground.

Otherwise, run the following to download pre-built binaries:

npm i -D @swc/cli @swc/core

Then, you can transpile your first file and emit to stdout:

npx swc ./file.js

Supported Binaries

SWC can be downloaded and used as a pre-built binary, or built from source. Currently, the following binaries are provided:

  • Mac (Apple Silicon)
  • Mac (x64)
  • Linux (x86_64)
  • Linux (aarch64)
  • Linux (armv7)
  • Alpine Linux (also install @swc/core-linux-musl)
  • Android (aarch64)
  • Windows (win32-x64)
  • Windows (ia32)

from  https://swc.rs/docs/getting-started
------

Make the web (development) faster.

npm Downloads undefined

CI Status

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.

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 swc

Backers on Open Collective Gold sponsors on Open Collective Silver sponsors on Open Collective Bronze sponsors on Open Collective

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).

from https://github.com/swc-project/swc

No comments:

Post a Comment