CLIActive

@swc/cli

Command-line interface for the SWC JavaScript/TypeScript compiler.

Open source page ↗

Product features

Product features

Config override

Override .swcrc config values from the command line with -C.

Directory compilation

Compile an input directory into an output directory with -d.

Flow input

Compile Flow code by setting jsc.parser.syntax to flow in a .swcrc file.

# minify

# minifySync

Node.js script usage

Use swcDir from @swc/cli programmatically in a Node.js script.

# parse

# parseFile

# parseFileSync

# parseSync

Source maps

Generate source maps with values true|false|inline|both via -s.

# @swc/core

# transform

# transformFile

# transformFileSync

# transformSync

Watch mode

Automatically recompile files on changes using the -w flag (requires chokidar).