styled-components / babel-plugin-styled-components

Improve the debugging experience and add server-side rendering support to styled-components
MIT License
1.07k stars 141 forks source link

Support auto import #403

Open otomad opened 1 year ago

otomad commented 1 year ago

I am using unplugin-auto-import with babel-plugin-styled-components.

Then we didn't required to explicit import { styled, createGlobalStyle } from "styled-components" and so on, just directly use them.

However, babel-plugin-styled-components doesn't recognize it, the styles won't be minify or use displayName unless you explicit import them.

How about add an option, then whether or not import them, just detect with keyword styled, createGlobalStyle and so on?