Webpack can't resolve svg when I try to use my svg as a background with relative path
image background-image: url('./checkmark.svg');
webpack give me 'can't resolve' error
But absolute path is ok.
background-image: url(C:\Users\leo\Desktop\project\hotel\src\components\checkbox-list\__menu\checkbox-list__checkbox\checkmark.svg);
Actualy my config rules:
module: {
rules: [{
test: /\.(?:ico|gif|png|jpg|jpeg)$/i,
type: 'asset/resource',
},
{
test: /\.scss$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
},
{
test: /\.(woff(2)?|eot|ttf|otf|svg)$/,
type: 'asset',
},
{
test: /\.pug$/,
loader: 'pug-loader',
options: {
pretty: true,
},
},
],
},