I try to use webpack with my react.js-application. The issue I am having is regarding the images. If I require the correct image in my entry-file, the image gets build to the correct destination, but my application can't find it. I just get a blank image:
main.jsx: require('./styles/images/logo.png');
in my application: <img src="images/logo.png" width="60%" alt="" />
When I require the image directly in the src-tag however everything is good:
<img src={require('../styles/images/logo.png')} alt="" width="80px" />
Is there anyone know what I am doing wrong? I would like to be able to just require the whole image-folder and every img-tag would be filled with the correct image. Any leads toward the solution would be much appreciated :)