javascript - vue's element-ui (are you hungry UI) externals cannot be separated when webpack is packaged?
漂亮男人
漂亮男人 2017-07-05 11:03:44
0
1
1363

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

漂亮男人
漂亮男人

reply all(1)
扔个三星炸死你

The code is as follows, and remove the use in your main.js

externals: {
    'element-ui': 'element-ui'
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template