Cargo Features

[dependencies]
swc_ecmascript = { version = "6.0.0", default-features = false, features = ["codegen", "concurrent", "minifier", "parser", "preset_env", "quote", "rkyv-impl", "transforms", "utils", "visit", "typescript-parser", "compat", "module", "optimization", "proposal", "react", "typescript"] }
default = typescript-parser

The typescript-parser feature is set by default whenever swc_ecmascript is added without default-features = false somewhere in the dependency tree.

codegen = swc_ecma_codegen
concurrent

Enables concurrent of swc_ecma_minifier

swc_ecma_minifier:

This enables global concurrent mode

minifier = swc_ecma_minifier
parser = swc_ecma_parser
preset_env = swc_ecma_preset_env
quote = swc_ecma_quote
rkyv-impl

Enables rkyv-impl of swc_ecma_ast

transforms = swc_ecma_transforms
utils = swc_ecma_utils
visit = swc_ecma_visit
typescript-parser default typescript?

Enables typescript of swc_ecma_parser

compat

Enables compat of swc_ecma_transforms

module

Enables module of swc_ecma_transforms

optimization

Enables optimization of swc_ecma_transforms

proposal

Enables proposal of swc_ecma_transforms

react

Enables react of swc_ecma_transforms

typescript = typescript-parser

Enables typescript of swc_ecma_transforms

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

swc_ecma_codegen codegen?
swc_ecma_minifier concurrent? minifier?
swc_ecma_parser parser? typescript-parser
swc_ecma_preset_env preset_env?
swc_ecma_quote quote?
swc_ecma_transforms compat? module? optimization? proposal? react? transforms? typescript?
swc_ecma_utils utils?
swc_ecma_visit visit?