const path = require('path')
// 1.导入插件,得到构造函数
const HtmlPlugin = require('html-webpack-plugin')
// 2.创建插件的实例对象
const htmlPlugin = new HtmlPlugin({
template: './src/index.html',
filename: './index.html'
})
module.exports = {
mode: 'development', // development production
// 指定打包的入口
entry: path.join(__dirname, './src/index.js'),
// 指定打包的出口
output: {
// 表示输出文件的存放路径
path: path.join(__dirname, './dist'),
// 表示输出文件的名称
filename: 'bundle.js',
},
plugins: [HtmlPlugin] //3.挂载插件的实例对象
}
各位,帮帮忙,看看怎么处理?