An HTML loader that adds width
and height
attributes to all img
tags in the HTML file.
Converts
<img src="logo.png"/>
into
<img src="logo.png" width="126" height="130"/>
npm install html-imgwh-loader
rules: [
{
test: /\.pug$/,
use: [
{
loader: 'html-loader'
},
{
loader: 'html-imgwh-loader'
},
{
loader: 'pug-html-loader',
options: {
pretty: true,
doctype: 'html'
}
}
]
}
]