鍍金池/ 問答/HTML/ webpack cli 和 webpack package 構(gòu)建有什么區(qū)別?

webpack cli 和 webpack package 構(gòu)建有什么區(qū)別?

情景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) => {})

兩者的產(chǎn)物不一致,主要是情景1產(chǎn)物中沒有 html-webpack-plugin 產(chǎn)生的 .html 文件

所以這兩種構(gòu)建方式有什么區(qū)別?

回答
編輯回答
雨萌萌

沒區(qū)別,第一種方式你也可以加上html-webpack-plugin生成html

2017年9月7日 20:29