Answer the question
In order to leave comments, you need to log in
How to set path to html and css images?
I have such settings for uploading pictures. Everything works for CSS but doesn't work for images in HTML because index.html is in the root of the project, if you remove the option publicPath: `../` then the paths for CSS will not be correct. Tell me how to set it up so that everything works? project structure in the photo below
{
test: /\.(png|jpe?g|gif|svg)$/,
use: [
{
loader: "file-loader",
options: {
publicPath: `../`,
name: "[path][name].[contenthash].[ext]",
},
},
],
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question