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!
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">
Previous: How to realize the search function of ant design pro table?
Next: SpringMvc access report 404, error will be reported when Tomcat is closed
question: use html-webpack-plugin to inject js files into template files. If a.js needs to introduce b.js in head, how should html-webpack-plugin be configured if it needs to be introduced in body? A.js is a global script file. ...
install webpack globally as an administrator, and confirm that it is successful (see figure) "webpack " webpack tried many ways (install webpack again in the project, set environment variables) did not solve ...