gajus / babel-plugin-react-css-modules

Transforms styleName to className using compile time CSS module resolution.
Other
2.05k stars 162 forks source link

Getting working with Preact #250

Open evenfrost opened 5 years ago

evenfrost commented 5 years ago

Seems styleName not being transformed to corresponding className when using preact. Tried to migrate same babel-plugin-react-css-modules config from existing React project but failed to get it working with Preact. Using preact-compat package.

Other issues (https://github.com/gajus/babel-plugin-react-css-modules/issues/200, https://github.com/gajus/babel-plugin-react-css-modules/issues/65) show notions of using Preact in their projects but no real evidence.

And slightly off-topic, but in case anyone stumbles upon styleName typings error when working with Preact, TypeScript and this plugin: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12040#issuecomment-480890380.

gajus commented 5 years ago

@evenfrost Are you available to debug this/ raise a PR if there is an issue?

evenfrost commented 5 years ago

Sorry, have no experience with Babel plugins development, but I can build up a reproduction repo if needed.

evenfrost commented 5 years ago

Also related: https://github.com/developit/preact/issues/498.