Vue配置CDN减轻包大小
index.html文件引入cdn
<script src="//cdn.bootcss.com/vue/2.5.2/vue.min.js"></script>
<script src="//cdn.bootcss.com/vue-router/3.0.1/vue-router.min.js"></script>
<script src="https://cdn.bootcss.com/vuex/3.0.1/vuex.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js"></script>
项目根目录创建vue.config.js文件
moudule.exports = {
configureWebpack : {
externals :{
vue : "Vue",
vuex : "Vuex",
"vue-router" : "VueRouter" ,
axios : "axios"
}
}
}
本文标题:Vue配置CDN减轻包大小
本文链接:https://www.haomeiwen.com/subject/wdigbktx.html
网友评论