Replacements for css-loader
css-loader is deprecated. webpack parses CSS itself, so the loader can be dropped from your config along with style-loader and mini-css-extract-plugin.
Built-in CSS support
Example:
js
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
module.exports = {
module: {
rules: [
{ test: /\.css$/i, use: [MiniCssExtractPlugin.loader, 'css-loader'] }
]
},
plugins: [new MiniCssExtractPlugin()]
}NOTE
Preprocessors still need their loaders. Sass, Less and PostCSS are not covered by built-in CSS support.