styled-components / babel-plugin-styled-components

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

When testing import paths, only use string literals. #389

Closed maisano-patreon closed 1 year ago

maisano-patreon commented 1 year ago

Prior to this change, code with template literals inside of require calls would break. This is because the check of t.isLiteral is far too broad for this usage, and assumes that all literals have a value property. Since TemplateLiteral nodes do not, they would cause picomatch to fail on an undefined input.

maisano-patreon commented 1 year ago

@probablyup any thoughts on this?