CodeVetter · Repo Unpack · Feature catalog
swc-project/swc
The principal public features are parsing, transformation, printing, and minification through synchronous and asynchronous APIs. Configuration supports language lowering, module formats, source maps, and custom transformations. Additional surfaces provide bundling, CLI compilation, HTML minification, CSS components, and React analysis. Availability depends on binding, target, and Cargo features; command names alone do not establish implementation.
- Compiler provides parse/parseSync and parseFile/parseFileSync with ECMAScript defaults and Script/Module overloads; filesystem parsing rejects the WASM fallback.
- transform and transformSync accept source text or Program ASTs, while transformFile variants accept paths; Config::adjust enables TSX for .tsx, disables it for .ts, and recognizes .d.ts.
- minify variants accept text or buffers and internally recognize object input; native object input must contain exactly one filename-to-source entry, and extras can share an experimental mangle-name cache.
- Compilation can emit source maps and inline source content, select CommonJS/UMD/AMD/SystemJS/ES6/NodeNext module configuration, and generate isolated declarations when the isolated-dts feature and TypeScript syntax are enabled.
- Node bundle loads configuration through compileBundleOptions, merges multiple bundle results, and delegates to native bindings; swc_v1 handles named/library bundles but rejects dynamic code splitting, while the alternate task implementation is unfinished.
- CLI compile supports stdin or files, config overrides, source maps, output files/directories, copying other files, and watching; plugin new scaffolds a Rust plugin, but CLI bundle, lint, and minify handlers call unimplemented!.
- The HTML native binding exposes document and fragment minification in async/sync forms; the Rust CSS facade exposes AST/parser/codegen plus feature-gated compatibility, minifier, modules, and prefixer components.
- React Compiler integration is exercised through jsc.transform.reactCompiler; a separate native binding exposes async/sync lint diagnostics and an isReactCompilerRequired check that returns true on parsing errors.