styled-components/babel-plugin-styled-components

[Question] npm library that uses styled-components, add babel-plugin-styled-components or not?

undrafted opened this issue · 3 comments

Hello, when building an SC-based npm library, should this plugin be included in the library's babel config, or let the host applications add it and transpile SC code?

Right now I actually see some class mismatch issues when both the library and the host has babel-plugin-styled-components in their respective babel configs.

Hi @undrafted! Did you find an answer for this question?

We have a similar issue here and we've been wondering if adding babel-plugin-styled-components to the library is correct or not.

@danielasy We decided to add it on the library. I asked the question because I was concerned about clashing classes in the end (in host projects vs the library) - but so far the hashing works great and no clashing classes yet. Once this issue is addressed clashing classes shouldn't be a concern anymore.

@undrafted thanks a lot!