The project is a multi-page website based on vue-cli. After element-ui is packaged into vendor, the vendor becomes very large, so I want to reference it to html in the form of script tags and exclude element-ui from my webpack configuration when packaging webpack. externals
externals: { moment: 'window.moment', jquery: 'window.$', 'element-ui':'ElementUI' },
Other moment jquery has been successfully excluded, but element-ui still exists in the vendor after packaging. I don’t know why
The code is as follows, and remove the use in your main.js