Skip to content

Conversation

@cyjake
Copy link
Contributor

@cyjake cyjake commented Jul 24, 2025

It looks like the transform-import plugin is just one option away from fully replace babel-plugin-import. When compiling imports of web component libraries like ant-design, babel-plugin-import will transform following import:

import { Button, InputNumber } from 'antd';

into

import Button from 'antd/lib/button';
import 'antd/lib/button/style';
import InputNumber from 'antd/lib/input-number';
import 'antd/lib/input-number/style';

Hence a corresponding config.style option is added to make transform-import plugin able to perform similar action. Should be able to close swc-project/swc#3042 for good.

@changeset-bot
Copy link

changeset-bot bot commented Jul 24, 2025

⚠️ No Changeset found

Latest commit: 6373423

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cyjake cyjake force-pushed the plugin-transform-style branch from 34f59a4 to 282eeba Compare July 24, 2025 08:35
@cyjake cyjake force-pushed the plugin-transform-style branch from 282eeba to 6373423 Compare July 24, 2025 08:39
@cyjake cyjake changed the title [wip] feat(transform-import): Add style option to fully replace babel-plugin-import feat(transform-import): Add style option to fully replace babel-plugin-import Jul 24, 2025
@kdy1 kdy1 merged commit bd98a2e into swc-project:main Jul 24, 2025
9 checks passed
@cyjake cyjake deleted the plugin-transform-style branch July 24, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants