Slider: Can't be used with css-modules

Created on 14 Mar 2017  路  5Comments  路  Source: react-component/slider

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.

All 5 comments

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';

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ka7eh picture ka7eh  路  3Comments

ihhha picture ihhha  路  4Comments

sonovice picture sonovice  路  7Comments

johnb8005 picture johnb8005  路  6Comments

teggno picture teggno  路  3Comments