extract-text-plugin

Output 2 (or more) .css files with mini-css-extract-plugin in webpack

半世苍凉 提交于 2019-12-03 03:58:13
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