一、安装依赖
yarn add html-webpack-plugin -S// 自动生成index.js文件
二、配置
const HtmlWebpackPlugin=require("html-webpack-plugin")const config={.....plugins:[new HtmlWebpackPlugin({template:path.join(__dirname,'public/index.html')})],mode:'development' // 模式}module.exports=config
