ben-rogerson / twin.macro

๐Ÿฆนโ€โ™‚๏ธ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, solid-styled-components, stitches and goober) at build time.
MIT License
7.92k stars 183 forks source link

Package doesn't work with esmudule declared configuration #728

Closed ninoman closed 2 years ago

ninoman commented 2 years ago

If you declaret your tailwind.config.js file as an ES Module, twin.macro starts to throwing an error twin.macro: Cannot use import statement outside a module, as I discovered it resolves the config file and uses require to import it.

As tailwind works fine with ES Module declarations, I feel twin.macro should support both.

Thank you

ben-rogerson commented 2 years ago

thanks - point taken - aligns with my own thoughts ๐Ÿ‘

spookyuser commented 1 year ago

Thank you sm for posting this @ninoman was getting this error and was sooo confused where it was coming from