I am adding a background image to my section in my scss file. The linear gradient is to darken the image. The url is correct and I am sure of it.
background-image: url(../../assets/img/hero-bg.jpg),
linear-gradient(rgba(black, 0.3), rgba(black, 0.3));
height: 1980px;
I am getting the following error -
ERROR in ./src/sass/main.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/sass/main.scss)
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Images through html are loading fine. This is my webpack config -
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/i,
use: [ 'style-loader',
'css-loader',
'sass-loader',
],
},
{
test: /\.html$/i,
use: ['html-loader'],
},
{
test: /\.(svg|jpeg|jpg|png|gif)$/i,
use: {
loader: 'file-loader',
options: {
name: '[name].[hash].[ext]',
publicPath: path.resolve(__dirname, '/assets/img'),
outputPath: 'assets/img',
},
},
}
],
plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: '[name].css',
}),
new HtmlWebpackPlugin({
template: '/src/template.html',
}),
],
Could someone solve this?