# Extension points — swc-project/swc

> Canonical page: https://codevetter.com/unpack/swc/extension-points

# Extension points — swc-project/swc

Scanned commit 3c46139b86b27a7b3fefcf7b19ca07a63de9db0a (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

SWC primarily extends through typed passes, visitor traits, feature-gated modules, and binding adapters. Plugins have a configurable sequence and an injectable execution runtime rather than a single permanently fixed backend. CLI operations follow a command enum and execution trait. Generated visitors and release carrier formats introduce additional maintenance contracts that extensions must preserve.
- Compiler::process_js_with_custom_pass accepts factories for before/after Pass implementations; its documented before-pass position follows decorators, resolver, and TypeScript stripping, and the after pass is appended to the built pass. — [crates/swc/src/lib.rs#L938-965](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/lib.rs#L938-L965) [crates/swc/src/lib.rs#L986-988](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/lib.rs#L986-L988)
- Visit provides per-node traversal hooks, and overriding a method requires explicit child recursion; the generated visitor file directs maintainers to tools/generate-code rather than manual edits. — [crates/swc_ecma_visit/src/generated.rs#L1-20](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc_ecma_visit/src/generated.rs#L1-L20) [tools/generate-code/src/main.rs#L25-35](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/tools/generate-code/src/main.rs#L25-L35) [tools/generate-code/src/main.rs#L57-64](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/tools/generate-code/src/main.rs#L57-L64)
- JscExperimental.plugins stores ordered PluginConfig module-name/JSON-option pairs; plugin_env_vars and cache_root configure host inputs, and run_plugin_first moves plugin execution ahead of built-in transforms. — [crates/swc/src/plugin.rs#L47-67](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/plugin.rs#L47-L67) [crates/swc/src/config/mod.rs#L1520-1544](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/config/mod.rs#L1520-L1544) [crates/swc/src/config/mod.rs#L945-963](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/config/mod.rs#L945-L963)
- RuntimeOptions::plugin_runtime accepts Arc<dyn Runtime>; Runtime implementers supply identifier, module preparation, initialization, and optional cache operations, with Wasmer chosen by the corresponding default feature. — [crates/swc/src/config/mod.rs#L205-228](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/config/mod.rs#L205-L228) [crates/swc_plugin_runner/src/runtime.rs#L26-73](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc_plugin_runner/src/runtime.rs#L26-L73)
- ModuleConfig is a tagged enum whose build function constructs module transformation passes; adding a format requires accounting for both the feature-enabled enum and the deserialization-only stub. — [crates/swc/src/config/mod.rs#L1600-1635](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/config/mod.rs#L1600-L1635) [crates/swc/src/config/mod.rs#L1640-1694](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/config/mod.rs#L1640-L1694)
- Bundler inputs are replaceable through Load, returning SourceFile, Module, and Helpers; Resolve is separately re-exported, allowing loading and module resolution to evolve independently. — [crates/swc_bundler/src/load.rs#L6-43](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc_bundler/src/load.rs#L6-L43) [crates/swc_bundler/src/resolve.rs#L1-1](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc_bundler/src/resolve.rs#L1-L1) [bindings/binding_core_node/src/bundle.rs#L34-38](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/bindings/binding_core_node/src/bundle.rs#L34-L38)
- CLI extensions plug into the Clap Command enum, implement CommandRunner::execute, and add dispatch in run; repository maintenance tasks use a separate xtask enum for Es, Bench, Git, Npm, and Clean. — [crates/swc_cli_impl/src/commands/mod.rs#L15-37](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc_cli_impl/src/commands/mod.rs#L15-L37) [crates/swc_cli_impl/src/lib.rs#L7-16](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc_cli_impl/src/lib.rs#L7-L16) [xtask/src/main.rs#L20-37](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/xtask/src/main.rs#L20-L37)
- Legacy JavaScript Plugin callbacks remain composable through plugins(ps) but are deprecated in favor of WASM; native and wasm32/plugin-disabled builds have different plugin availability branches, including warning-and-skip behavior. — [packages/core/src/index.ts#L133-143](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/packages/core/src/index.ts#L133-L143) [packages/core/src/index.ts#L304-335](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/packages/core/src/index.ts#L304-L335) [crates/swc/src/config/mod.rs#L849-900](https://github.com/swc-project/swc/blob/3c46139b86b27a7b3fefcf7b19ca07a63de9db0a/crates/swc/src/config/mod.rs#L849-L900)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
