安装:cnpm install html-webpack-plugin -D
使用:在webpack.config.js文件里面添加配置:
const htmlWebpackPlugin = require(‘html-webpack-plugin‘)
module.exports = {
plugins: [
new htmlWebpackPlugin({
template: path.join(__dirname, ‘./src/index.html‘),
filename: ‘index.html‘
})
]
}
作用:
原文:https://www.cnblogs.com/sunshinexiu/p/12496948.html