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.
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.