Skip to content

redundant imports cause default-export version to not be transformed #392

Open
@gregorjan

Description

@gregorjan

When using named import from styled-components both babel and swc plugins are not used.

image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions