What's the difference between webpack cli and webpack package builds?

scenario 1

const config = {
  entry: {},
  output: {},
  module: {},
  plugins: {},
}

webapck(config, (err, stat) => {})
The products of

and

are inconsistent, mainly because there is no .html file generated by html-webpack-plugin in scenario 1

.

so what"s the difference between the two build methods?

Mar.21,2021

makes no difference. In the first way, you can also add html-webpack-plugin to generate html

.
Menu