Open DevTools and look at div with text styled-test-swc
However, there is no such problem with babel-plugin-styled-components. To check this, you can comment out lines 1 and 7 and uncomment lines 2 and 8 in the vite.config.js file.
Screenshots
Screenshot with @swc/plugin-styled-components:
![CleanShot 2024-08-03 at 03 08 24](https://github.com/user-attachments/assets/db2ba6e8-fe9f-48f0-b79e-3d30f252f558)
Screenshot with babel-plugin-styled-components:
![CleanShot 2024-08-03 at 03 08 51](https://github.com/user-attachments/assets/15d91e8e-6d94-4c51-bdff-e2b3226bd9d0)
Description of problem
displayName
is not displayed when importing styled-component from.js
file in React, although there is no such problem when importing from.jsx
.Steps to reproduce
git clone https://github.com/rakleed/styled-test-swc
npm install && npm run dev
styled-test-swc
However, there is no such problem with
babel-plugin-styled-components
. To check this, you can comment out lines 1 and 7 and uncomment lines 2 and 8 in thevite.config.js
file.Screenshots
Screenshot with @swc/plugin-styled-components:
![CleanShot 2024-08-03 at 03 08 24](https://github.com/user-attachments/assets/db2ba6e8-fe9f-48f0-b79e-3d30f252f558)Screenshot with babel-plugin-styled-components:
![CleanShot 2024-08-03 at 03 08 51](https://github.com/user-attachments/assets/15d91e8e-6d94-4c51-bdff-e2b3226bd9d0)Minimal reproduction
https://github.com/rakleed/styled-test-swc