DEV Community

Discussion on: What is the best way to distribute styles with npm package?

Collapse
 
thekashey profile image
Anton Korzunov

css-modules-require-hook is just a good example of a node-loader. Like - you may process source CSS and transform to the thing you need, like you may do using webpack-loader.
Almost nobody consider this as an option, or calling some loader-based approaches bad, cos they are not repeatable for node, while they are :)

Thread Thread
 
andreynovikovrelef profile image
Andrey Novikov • Edited

What about babel-plugin-transform-postcss? I think this is better than css-modules-require-hook, because postcss and postcss-modules are used directly. And no CSS is actually included in the resulting JavaScript

Thread Thread
 
thekashey profile image
Anton Korzunov

A very good option