What is the role of entry.vendor in webpack configuration

has not carefully studied the common code extraction of webpack before, and recently the project began to look back after bug, but after looking for a lot of information, there is a problem that has not been solved, that is, the relationship between entry.vendor and CommonChunkPlugin?

guess 1: the packages defined in vendor [] must be extracted as public dependencies vendor.js, but other dependencies will be introduced according to the configuration of CommonsChunkPlugin.

conjecture 2: only the packages defined in vendor [] will be extracted as public dependencies vendor.js other dependencies will not.

I am more inclined to guess one, but there is no detailed evidence on the data, so I would like to ask you.

Mar.09,2021

  1. vendor means dependent third-party libraries that do not change frequently, such as jQuery in your code
  2. CommonsChunkPlugin refers to the chunks that you have repeatedly quoted. It could be vendor, or one of your own common components
Menu