search

Home  >  Q&A  >  body text

javascript - vue's element-ui (are you hungry UI) externals cannot be separated when webpack is packaged?

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

漂亮男人漂亮男人2733 days ago1383

reply all(1)I'll reply

  • 扔个三星炸死你

    扔个三星炸死你2017-07-05 11:05:44

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

    externals: {
        'element-ui': 'element-ui'
    }

    reply
    0
  • Cancelreply