So i'm trying to integrate both of this modules into my project and i have difficulties in dealing with its CSS part.
My project is using postcss to turn my own css files into "compiled" css files with added classnames to each of them. Both react-virtualized and react-select have their own css files to define the styling, however i do not understand how i can override them or integrate them into my project.
My webpack css config is the following:
[
{ loader: 'style-loader' },
{
loader: 'css-loader',
options: {
localIndentName,
sourceMap: true,
modules: true,
importLoaders: 1
}
},
{
loader: 'postcss-loader',
options: {
plugins: [
postcssImport({ path: path.resolve(PATHS.app, './css') }),
postcssCssnext({ browsers: ['> 1%', 'last 2 versions'] }),
postcssReporter({ clearMessages: true })
]
}
}]
{
test: /\.css$/,
use: loaders
}
When i do the following line in my main app.js file, then i get a failed parsing error of the css (Unexpected token).
import 'react-virtualized/styles.css';
The only way i was able to load the CSS styles is using
import '!style-loader!css-loader!./css/unstyled/react-virtualized.css';
Meaning, copy the whole CSS into my own project and importing it without the postcss working. However, i dont know if this is the best way because its very explicit of working with those modules.
Does anyone has a better solution?