Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't identify styled components in pre-transpiled code #379

Open
rbong opened this issue Jul 30, 2022 · 2 comments
Open

Doesn't identify styled components in pre-transpiled code #379

rbong opened this issue Jul 30, 2022 · 2 comments

Comments

@rbong
Copy link
Contributor

rbong commented Jul 30, 2022

Imports which use _interopRequireDefault are not identified.

// not identified
const styled = _interopRequireDefault(require("styled-components"));

Calls using SequenceExpressions are also not identified.

const Test = (0, styled)('div')();
@rbong rbong changed the title CommonJS imports not identified Doesn't identify styled components in pre-transpiled code Jul 30, 2022
@rbong
Copy link
Contributor Author

rbong commented Jul 30, 2022

This is what causes #365

rbong added a commit to rbong/babel-plugin-styled-components that referenced this issue Jul 30, 2022
rbong added a commit to rbong/babel-plugin-styled-components that referenced this issue Jul 30, 2022
@eckmLJE
Copy link

eckmLJE commented Sep 1, 2022

We have run into this issue using module federation and our in-house component library. babel-plugin-styled-components successfully namespaces styled components written within each app, preventing class name collision when multiple apps are loaded on the same page with module federation. However, each app also imports from our component library which is already transpiled, and these component class names are not namespaced, leading to class name collision bugs.

Commenting to add our support for @rbong's PR to add this support after testing it in our dev environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants