When using webpack 2(or 3), I could write code like:
const coreStyles = new ExtractTextPlugin('./styles/core.bundle.css');
const componentStyles = new ExtractTextPlugin('./styles/components.bundle.css');
rules: [
{
test: /\.scss$|\.css$/,
include: path.resolve(__dirname, './styles/App.scss'),
use: coreStyles.extract({
use: ['css-loader', 'sass-loader']
})
},
{
test: /\.scss$|\.css$/,
exclude: path.resolve(__dirname, './styles/App.scss'),
use: componentStyles.extract({
use: ['css-loader', 'sass-loader']
})
}
]
And as a result, I got 2 css files in output.
How can I reach the same with mini-css-extract-plugin
? As according to the docs I can specify only one file name:
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
})
]
Thanks.