LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

swc

Fast Rust-based JavaScript and TypeScript compiler

TLDR

Compile file
$ swc [input.js] -o [output.js]
copy
Compile directory
$ swc [src/] -d [dist/]
copy
Watch mode
$ swc [src/] -d [dist/] -w
copy
With source maps
$ swc [input.js] -o [output.js] --source-maps
copy
Use config file
$ swc [input.js] -o [output.js] --config-file [.swcrc]
copy

SYNOPSIS

swc [-o output] [-d dir] [-w] [options] input

DESCRIPTION

swc (Speedy Web Compiler) is a JavaScript and TypeScript compiler written in Rust, designed as a significantly faster alternative to Babel. It handles transpilation, JSX transformation, TypeScript stripping, and minification in a single tool.The compiler supports modern JavaScript features, downlevel compilation to older targets, and React JSX transformation. TypeScript files are compiled by stripping types without performing type checking, making it much faster than tsc for builds where type checking is handled separately.SWC can process individual files, entire directories with watch mode for development, and generates source maps for debugging. It is used as the compilation engine by tools like Next.js and Parcel.

PARAMETERS

-o FILE

Output file.
-d DIR
Output directory.
-w
Watch mode.
--source-maps
Generate source maps.
--config-file FILE
Configuration file.
--sync
Synchronous mode.

CONFIGURATION

.swcrc

Project configuration file in JSON format defining compilation target, module type, JSX settings, and minification options.

INSTALL

sudo apk add swc
copy
brew install swc
copy
nix profile install nixpkgs#swc
copy

CAVEATS

Less plugins than Babel. Rust ecosystem. Config differs from Babel.

HISTORY

SWC (Speedy Web Compiler) was created by Donny as a fast JavaScript/TypeScript compiler written in Rust.

SEE ALSO

babel(1), tsc(1), esbuild(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid