Cargo Features

[dependencies]
swc = { version = "0.273.7", default-features = false, features = ["concurrent", "debug", "es3", "node", "plugin", "plugin_transform_schema_v1", "plugin_transform_schema_vtest", "plugin_transform_host_js", "plugin_transform_host_native"] }
concurrent

TODO: This may need reorganization with swc_core - swc_core allows to optionally enable each features (minifier, transforms..) but swc includes all of them.

Enables concurrent of swc_common, swc_ecma_minifier, and swc_ecma_transforms

default = es3

The es3 feature is set by default whenever swc is added without default-features = false somewhere in the dependency tree.

debug

Enables debug of swc_ecma_minifier and swc_ecma_visit

es3 default
node = napi, napi-derive

Enables node of swc_compiler_base

plugin

Enables plugin-rt of swc_plugin_proxy, ecma and rkyv-impl of swc_plugin_runner

Affects config::PLUGIN_MODULE_CACHE, config::init_plugin_module_cache_once

plugin_transform_schema_v1

Enables plugin_transform_schema_v1 of swc_common and swc_plugin_runner

plugin_transform_schema_vtest

Enables plugin_transform_schema_vtest of swc_common and swc_plugin_runner

plugin_transform_host_js

Enables plugin_transform_host_js of swc_plugin_runner

plugin_transform_host_native

Enables plugin_transform_host_native of swc_plugin_runner

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

swc_plugin_proxy plugin?
swc_plugin_runner plugin? plugin_transform_host_js? plugin_transform_host_native? plugin_transform_schema_v1? plugin_transform_schema_vtest?
napi node?
napi-derive node?