Search code examples
htmlwebpackwebpack-5

How to load images in webpack 5 without using JavaScript


I hope this question is not completely stupid. I am currently building a website using only plain HTML in Webpack. When I try to load images as usual, using the img tag and the src attribute, my images are not displayed. I found this in the webpack documentation. But there it only describes how I load images via JavaScript.

webpack Documentation


Solution

  • For all those who have a similar problem. You must first load the html-loader to be able to load images in your HTML files.