px-vivo-loder-with-html-img
本插件是抄袭修改了 inline-html-withimg-loader。
安装
npm install px-vivo-loder-with-html-img --save
使用
webpack配置:
new HtmlWebpackPlugin({
filename: 'index.html'
template: 'px-vivo-loder-with-html-img!'+path.resolve(__dirname, '../src/index.html'),
}),
new webpack.optimize.CommonsChunkPlugin({
names: ['manifest', 'vendor'].reverse(),
minChunks: Infinity, // 随着 入口chunk 越来越多,这个配置保证没其它的模块会打包进 公共chunk
}),
new InlineManifestWebpackPlugin()
index.html:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Template</title>
<%= htmlWebpackPlugin.files.webpackManifest %>
</head>
<body>
<div id="app">
<img src="./imges/a.jpg">
</div>
</body>
</html>