gajus / babel-plugin-react-css-modules

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

Seperate runtime #276

Closed wallzero closed 4 years ago

wallzero commented 4 years ago

I am using babel-plugin-react-css-modules in a couple libraries I work on (ui-router-react-digest, react-ag). With babel and webpack, I am able to bundle these libraries into a single .js and .css - and with babel-plugin-react-css-modules, my CSS class names are locally scoped.

However, there has been confusion whether downstream library users must install babel-plugin-react-css-modules. For example, some projects may not be using babel, so users don't understand why they require a babel plugin along with its dependencies.

I'm curious if it is possible separate the runtime component into another package - perhaps something like react-css-modules-runtime? That would be easier to pass as a downstream dependency.

Thanks!

gajus commented 4 years ago

However, there has been confusion whether downstream library users must install babel-plugin-react-css-modules. For example, some projects may not be using babel, so users don't understand why they require a babel plugin along with its dependencies.

Downstream projects do not need to use Babel, but you have to have babel-plugin-react-css-modules as a dependency (not devDependency).

wallzero commented 4 years ago

Thanks I get that. I just think it'd be easier if the runtime was a separate package.