Vue project two html files, now both pages use the same vendor.js, this JS file is too large, how to introduce their own module package for each page?

because both html files refer to the same vendor.js, this js file packages the common modules of the two pages together, which is relatively large. Now one of the pages uses fewer modules, so can each page reference its own vendor.js, so that the volume will not be too large? I don"t know how to configure webpack. Thank you very much!

Jun.02,2021

vendor.js is important because your dependent libraries are packaged into vendor. You can use webpack's externals to introduce dependent libraries in the form of cdn. Reduce the volume of vendor. Specific configuration can be Baidu. It is relatively simple


you can use routing laziness to load

Menu