redundant imports cause default-export version to not be transformed
gregorjan opened this issue · 1 comments
gregorjan commented
When using named import from styled-components both babel and swc plugins are not used.
Funnily enough in codesandbox the behavior is exact opposite
Environment
System:
- OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
- CPU: (2) x64 AMD EPYC
- Memory: 617.30 MB / 2.01 GB
- Container: Yes
- Shell: 5.8 - /bin/zsh
Binaries:
- Node: 18.15.0 - /usr/local/bin/node
- Yarn: 1.22.19 - /usr/local/bin/yarn
- npm: 9.5.0 - /usr/local/bin/npm
npmPackages:
- babel-plugin-styled-components: ^2.1.3 => 2.1.3
- styled-components: ^6.0.0-rc.2 => 6.0.0-rc.2-4007
Reproduction
https://codesandbox.io/p/sandbox/jolly-haze-sf21k4
Steps to reproduce
Use babel-plugin-styled-components and named import from styled-components package
Expected Behavior
displayName is correctly added to class
Actual Behavior
displayName is not added to class
quantizor commented
When using named import from styled-components both babel and swc plugins are not used.
Actually looking at your sandbox, it looks like only the button using the named import worked... I wonder if the plugin can handle one or the other but not both.