How vue-cli3 configures externals

problem description

after the vue-cli project is upgraded to vue-cli3.0, externals does not know how to configure it, so element-ui "s cdn will not be used

the environmental background of the problems and what methods you have tried

chainWebpack configuration has been tried, but will not be configured

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Mar.23,2022

the first step in loading the configuration is to introduce the third-party package into the index.html file under public

<script src="https://cdn.bootcss.com/vue/2.5.21/vue.js"></script>

create a new vue.config.js file in the root directory, and configure vue-cli3.0

module.exports = {
  configureWebpack:{
    externals: {
       'vue': 'Vue',
       'jquery' : '$',
    }
  },
};

refer directly to import $from 'jquery';
package npm run build

('')?! Why < script > vue-router should be written in front of vue, otherwise an error will be reported.

Menu