feat(swc): Make module transforms optional via module feature#11509
feat(swc): Make module transforms optional via module feature#11509
module feature#11509Conversation
This change makes `swc_ecma_transforms_module` an optional dependency of the `swc` crate. Bundlers typically handle module transforms themselves, so they don't need this code, reducing binary size. Changes: - Add `module` feature to `swc` crate that enables module transforms - Gate all module-related code with `#[cfg(feature = "module")]` - Add `base_module` feature to `swc_core` that enables `swc/module` - Update `swc_cli_impl`, `binding_core_node`, and `binding_core_wasm` to explicitly enable the module feature By default, the `swc` crate no longer includes module transforms. Users who need CommonJS, AMD, UMD, or SystemJS transforms must enable the `module` feature explicitly. Closes #11505 Co-Authored-By: Donny/강동윤 <kdy1@users.noreply.github.com>
🦋 Changeset detectedLatest commit: ffd4ad3 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
Binary Sizes
Commit: 7b0035d |
|
@claude fix ci |
This comment has been minimized.
This comment has been minimized.
The Context trait is used in both the module and plugin feature code paths, so the import needs to be gated by either condition. Co-authored-by: Donny/강동윤 <kdy1@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
|
@claude fix ci |
This comment has been minimized.
This comment has been minimized.
This ensures tests run with module transforms enabled, fixing the babel exec test failures. Co-authored-by: Donny/강동윤 <kdy1@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
PR Review: Make module transforms optional via
|
Summary
Make
swc_ecma_transforms_modulean optional dependency of theswccrate. Bundlers typically handle module transforms themselves, so they don't need this code, reducing binary size.Changes
modulefeature toswccrate that enables module transforms#[cfg(feature = "module")]base_modulefeature toswc_corethat enablesswc/moduleswc_cli_impl,binding_core_node, andbinding_core_wasmto explicitly enable the module featureCloses #11505
Generated with Claude Code