动态生成html插件

//html-webpack-plugin html生成插件

1.new HtmlWebpackPlugin(
{
title: '系统入口',
template: './src/template/index.html', // Load a custom template
favicon:'favicon.ico',
inject: 'body', // Inject all scripts into the body
filename: "index.html",
minify: { //压缩HTML文件
removeComments: true, //移除HTML中的注释
collapseWhitespace: true, //删除空白符与换行符
removeEmptyAttributes: false //删除空的属性
}
}
),
2.html中
<%= 变量名%>  //变量名为功能代码块 可写逻辑代码
posted @ 2017-09-04 10:07  小贱贱!  阅读(179)  评论(0)    收藏  举报