简体   繁体   中英

I am continuously getting a error when importing css file of the select to library in a react app

I am using select2 library in my react app to add some drop downs. When i am importing the css file it gives a error saying "you may need a appropriate loader to handle this file type". so how can fix this error. In my project i am using SCSS to style my components.

picture of the error

My loader in webpack.config.js is like this

{
  test: /\.scss$/,
  loader: 'style-loader!css-loader!sass-loader'
}

You can add another loader right before your scss loader

{
  test: /\.css$/,
  loader: 'style-loader!css-loader'
},
{
  test: /\.scss$/,
  loader: 'style-loader!css-loader!scss-loader'
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM