Cargo Features

[dependencies]
swc = { version = "6.0.0", 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", "manual-tokio-runtmie", "manual-tokio-runtime"] }
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 = tokio

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

manual-tokio-runtmie = manual-tokio-runtime

Do not inject tokio runtime while running plugin transforms

manual-tokio-runtime manual-tokio-runtmie?

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_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?
tokio plugin?