webpack4.x里使用html-withimg-loader使html-webpack-plugin产生错误【解决】
使用html-withimg-loader打包html中img引入的图片,很好用,但是webpack4.x里会和html-webpack-plugin产生冲突;
原因是file-loader升级了,以前4.2的时候是没事的,现在file-loader升级到5.0了,所以需要在file-loader的options里使用一个配置:
esModule:false
这样就解决了;
http://websong.gitee.io/songyublog/