const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = function (paths) {
return {
module: {
rules: [
{
test: /\.scss$/,
include: paths,
use: [
{
loader: MiniCssExtractPlugin.loader({
options: {
publicPath: "../",
},
fallback: "style-loader",
use: ["css-loader", "sass-loader"],
}),
}
],
},
{
test: /\.css$/,
include: paths,
use: [
{
loader: MiniCssExtractPlugin.loader({
fallback: "style-loader",
use: "css-loader",
}),
},
],
},
],
},
plugins: [new MiniCssExtractPlugin("./css/[name].css")],
};
};