对。可以在一个webpack配置文件中设置多个配置。
小例子:
module.exports = [
{
entry: {
block1: "./block1/index.js"
},
output: {
filename: "[name].build.js",
path: path.resolve(__dirname, "block1/build")
}
},
{
entry: {
block2: "./block2/index.js"
},
output: {
filename: "[name].build.js",
path: path.resolve(__dirname, "block2/build")
}
}]
module.exports =
{
entry: {
block1: "./block1/index.js"
block2: "./block2/index.js"
},
output: {
filename: "./[name]/build/[name].build.js"
}
}