Below is the important section from my webpack.config.js
file:
module: {
loaders: [
{
test: /\.css$/,
exclude: /node_modules/,
loaders: [
"style-loader?sourceMap",
"css-loader?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]"
]
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader"
}
]
}
Currently, this setup works well for my custom css used with React
components. But I encountered an issue when trying to use React Datepicker, as it includes its own css files that should not be affected by CSS Modules.
Is there a way to adjust my webpack.config.js
so that external styles like those from React Datepicker are imported globally while keeping my own styles local to the component?
In addition, if I want to create custom styles that override React Datepicker's styles, how can I ensure they are also applied globally?