I am doing a project with webpack4 from scratch. But when I try to display an image in an HTML file, I face a weird problem:
After npm run build
, the src of image tag is built as <image src="[object Module]"
.
The HTML part is:
<img src="images/main_background.jpg">
The webpack.config.js
is this :
// ignore ...
{
test: /\.html$/,
use: [
{loader: 'html-loader'}
]
},
{
test: /\.(jpeg|jpg|png)$/,
use: [
'file-loader'
]
}
And the version of these two loaders:
"file-loader": "^5.0.2",
"html-loader": "^0.5.5",
I can't figure out what the issue is...