Your component looks really nice, but unfortunately it's unusable with a webpack and css-modules config.
You should split and import yout css files directly per component. It would be transparent for everybody.
no time for this锛宨f you want to use css-module in your project锛宩ust exclud rc-slider
For the reference, the same request with longer discussion: https://github.com/react-component/slider/issues/154
I mean in your css-loader config:
{
test: /\.css$/,
loader: "style-loader!css-loader?modules"
exclude: [require.resolve('rc-slider')]
},
With the new webpack config, it is:
{
test: /\.css$/,
include: /node_modules\/rc-slider/,
use: ['style-loader', 'css-loader']
},
Ugh none of this did it for me. Here is my solution:
styles.scss
:global {
@import '~rc-slider/assets/index';
}
import
import './styles.scss';