How webpack dev server accesses pictures

put the source code under the src folder, where css references images under the same src directory through the relative path. After starting webpack dev server, through npm run dev, the path of the image accessed becomes localhost:8080/img/pic1.jpg, because the image is not placed on the server, so it cannot be accessed. Would you like to ask how to set it? Thank you


I think you may not be a relative path. The default image path of the relative path will be compiled

check whether the image path below is written as / img/pic1.jpg

Menu