功能:自動生成html模板html
var HtmlWebpackPlugin = require('html-webpack-plugin') webpack
module.exports = {git
...,github
plugins: [web
new HtmlWebpackPlugin({ui
filename: config.build.index //配置的html文件目錄是相對於output.path路徑spa
template: 'index.html' //本地模板文件的位置htm
inject: true //注入全部靜態資源blog
minify: {資源
removeComments: true, //刪除註釋
collapseWhitespace: true, //刪除空格
removeAttributeQuotes: true //刪除引用
}
})
]
}
資料: https://www.cnblogs.com/wonyun/p/6030090.html