情景1
// config.js
module.exports = {
entry: {},
output: {},
module: {},
plugins: {},
}
// cmd
webpack --config config.js
情景2
const config = {
entry: {},
output: {},
module: {},
plugins: {},
}
webapck(config, (err, stat) => {})
两者的产物不一致,主要是情景1产物中没有 html-webpack-plugin
产生的 .html 文件
所以这两种构建方式有什么区别?
没区别,第一种方式你也可以加上html-webpack-plugin生成html