const{resolve}=require(‘path‘);
module.exports={
entry:{//entry声明为一个对象,每个入口配置为其中的一个属性
test0:‘./src/index.js‘,
test1:‘./src/main.js‘},
output:{
path:resolve(__dirname,‘build‘),
filename:‘[name].js‘//输出文件使用[name],表示使用上面对应的test0和test1来命名生成出来的文件
},
mode:‘development‘,
module:{
rules:[]
},
plugins:[
]
}
3.当然也可以使用上面两种方式混合,只需要将entry中的属性的值设置为一个数组即可