module.exports常见是对象类型,其实也可用数组类型;another.js,再编 index.js;true,仅在第一次,也就是代码第19行设置一次即可清空整个 output 文件夹;true,则在编 index.js时,会删除another.js 已编译好的文件;module.exports = [
{
mode: 'production',
entry: {
"indexs": './index.js' ,
},
output: {
filename: '[name].js',
// clean: true,
}
},
{
mode: 'production',
entry: {
"another": './another.js' ,
},
output: {
filename: '[name].js',
clean: true, // 在每次构建前清理 output 文件夹
}
}
];