when i use html-loader and file loader then in development mode image in not dispaly on browser images in src->assets->images folder and in html file
please suggest me what i can do to run the code in both development and product mode
<html>
<head>Webpack</head>
<body>
<h1>Hi...................!</h1>
<h1>Owsam!</h1>
<img src="../src/assets/images/rajstan.jpg">
</body>
</html>
const road = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
module:{
rules :[
{
test : /\.css$/,
use : ['style-loader','css-loader']
},
{
test : /\.html$/,
use : [
{
loader : "html-loader",
}
]
},
{
test : /\.(svg|png|jpe?g|gif)$/,
use : [
{
loader : "file-loader",
// options : {
// name: '[name].[ext]',
// // outputPath : 'images',
// // publicPath : 'assets'
// }
}
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
title : 'first webpack',
filename : 'index.html',
template : road.resolve(__dirname,'..','public','index.html'),
inject:'body'
})]
}