diff --git a/Cargo.lock b/Cargo.lock index d1fca79d3abb..a3bf9ea720b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4907,6 +4907,7 @@ dependencies = [ "swc_malloc", "swc_node_comments", "swc_plugin_backend_wasmer", + "swc_plugin_backend_wasmtime", "swc_plugin_proxy", "swc_plugin_runner", "swc_sourcemap", diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index a38bc4148403..aaf0f208ef8b 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -46,10 +46,14 @@ plugin_transform_schema_vtest = [ # Enable wasmer plugin runtime implement plugin_backend_wasmer = ["swc_plugin_backend_wasmer"] +# Enable wasmtime plugin runtime implement +plugin_backend_wasmtime = ["swc_plugin_backend_wasmtime"] -plugin_transform_host_js = ["swc_plugin_backend_wasmer/plugin_transform_host_js"] +plugin_transform_host_js = [ + "swc_plugin_backend_wasmer?/plugin_transform_host_js", +] plugin_transform_host_native = [ - "swc_plugin_backend_wasmer/plugin_transform_host_native", + "swc_plugin_backend_wasmer?/plugin_transform_host_native", ] # Do not inject tokio runtime while running plugin transforms manual-tokio-runtime = [] @@ -94,7 +98,9 @@ swc_ecma_loader = { version = "15.0.0", path = "../swc_ecma_loader", features = "tsc", ] } swc_ecma_minifier = { version = "34.0.2", path = "../swc_ecma_minifier" } -swc_ecma_parser = { version = "25.0.0", path = "../swc_ecma_parser", default-features = false, features = ["typescript"] } +swc_ecma_parser = { version = "25.0.0", path = "../swc_ecma_parser", default-features = false, features = [ + "typescript", +] } swc_ecma_preset_env = { version = "37.0.0", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "36.0.0", path = "../swc_ecma_transforms", features = [ "compat", @@ -111,9 +117,10 @@ swc_ecma_utils = { version = "22.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "16.0.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "17.0.0", path = "../swc_error_reporters" } swc_node_comments = { version = "15.0.0", path = "../swc_node_comments" } +swc_plugin_backend_wasmer = { version = "3.0.0", path = "../swc_plugin_backend_wasmer", optional = true, default-features = false } +swc_plugin_backend_wasmtime = { version = "2.0.0", path = "../swc_plugin_backend_wasmtime", optional = true, default-features = false } swc_plugin_proxy = { version = "16.0.0", path = "../swc_plugin_proxy", optional = true } swc_plugin_runner = { version = "20.0.0", path = "../swc_plugin_runner", optional = true, default-features = false } -swc_plugin_backend_wasmer = { version = "3.0.0", path = "../swc_plugin_backend_wasmer", optional = true, default-features = false } swc_timer = { version = "1.0.0", path = "../swc_timer" } swc_transform_common = { version = "9.0.0", path = "../swc_transform_common" } swc_typescript = { version = "21.0.0", path = "../swc_typescript", optional = true } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index b5d61c6be9c0..392d3900489a 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -231,6 +231,9 @@ plugin_transform_host_native_shared_runtime = [] # Enable wasmer plugin runtime implement plugin_backend_wasmer = ["swc/plugin_backend_wasmer"] +# Enable wasmtime plugin runtime implement +plugin_backend_wasmtime = ["swc/plugin_backend_wasmtime"] + # Enable parallel execution of various modules, including minifier using chili parallel_chili = ["par-core/chili"] # Enable parallel execution of various modules, including minifier using rayon @@ -307,8 +310,8 @@ __plugin_transform_host = [ ] # Internal flags to control plugin environment +__plugin_transform_env_js = ["swc/plugin_transform_host_js"] __plugin_transform_env_native = ["swc/plugin_transform_host_native"] -__plugin_transform_env_js = ["swc/plugin_transform_host_js"] # Do not use: testing purpose only # Force enable different version of AST schema