I am using Webpack for the first time and my images wont load...404 error. It seems that the images are not getting to my dist folder. If I manually insert the image files into the dist folder, then they will display. My understanding is that Webpack generates everything in the dist folder when you run it. This leads me to believe that the issue in my module rules.
Here is my image tag:
<img class="img-responsive" src=<%=('images/tech-town-showcase-students.JPG') %> alt="students meeting with tech business owner"/>
And from my config.js:
module: {
rules: [
{
test: /.scss$/,
use: cssConfig
},
{
test: /.(jpe?g|png|gif|svg)$/i,
use: [
'file-loader?name=images/[name].[ext]',
'image-webpack-loader'
]
},
I tried adding the dist folder to the path like this:
'file-loader?name=dist/images/[name].[ext]',
but that didn't help. What else should I be looking at?
See Question&Answers more detail:os