ERROR in Error: html-webpack-plugin could not minify the generated output.
In production mode the html minifcation is enabled by default.
If you are not generating a valid html output please disable it manually.
You can do so by adding the following setting to your HtmlWebpackPlugin config:
|
| minify: false
|
See https://github.com/jantimon/html-webpack-plugin#options for details.
For parser dedicated bugs please create an issue here:
https://danielruf.github.io/html-minifier-terser/
Parse Error: <img src={"default":"http://localhost:1314/images/3a20d65bb1002e88864883b2129b6b34.png"} width="30%" /></ div> <div id="photo"></div> <div id="title"></div><script src="http://localhost:1314/entry.js?1a42b1ca85daaea2ac a2"></script></body></html>
如果按照提示设置minify为false,则显示不了图片,正确的做法是在webpack.config.js文件中的url-loader配置下面的属性:
test: /\.(png|jpg|gif)/,
use:[{
loader:'url-loader',
options:{
limit:500000,
outputPath: 'images/',
esModule:false //解决方法
}
}]
菜鸟不太懂原理,还请大神们多多指教~