Who can help me with a problem in the Webpack settings when adding @import to style.scss webpack returns ModuleBuildError.
webpack.config.js
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: {
main: path.join(__dirname, 'src', 'webpack_entry_point'),
},
output: {
filename: 'bundle.[hash].js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new MiniCssExtractPlugin({
filename: 'style.[contenthash].css'
})
],
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
include: path.resolve()
},
{
test:/\.scss$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"sass-loader"
]
}
]
}
};
webpack_entry_point.js
import './webpack_style.scss';
webpack_style.scss
@import 'css/style';
