HtmlWebpackPlugin cannot be parsed after using html-withimg-loader?

problem: because you want to introduce pictures directly into the html file through the img tag, html-withimg-loader is configured in webpack. But in this way, a similar <% = htmlWebpackPlugin.options.title% > in the html file cannot be parsed!


Why do you want to use a small loader, like html-withimg-loader? you don't have this problem if you use html-loader .


using html-loader can also cause conflicts, and htmlWebpackPlugin can introduce pictures through requier.

<img src="<%= require('./images')%>" alt="picture">
Menu