Vue Cli4与Vue Cli2区别浅谈 当时学习 Vue Cli 的时候看的是 Vue Cli2 的相关教程,当把 package.json 上传 github 的时候提醒有安全问题,于是准备使用
Vue-Cli4与Vue-Cli2区别浅谈
vue create my-project
# OR
vue ui # 可视化操作
npm install -g @vue/cli-init
"scripts": {
"serve": "vue-cli-service serve","build": "vue-cli-service build"
}
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.https://cli.vuejs.org/zh/guide/html-and-static-assets.html#preload
/* webpackChunkName: "about" */
配置代理
module.exports = {
devServer: {
proxy: {
'/': {
target: 'http://www.example.com',ws: true,changeOrigin: true,pathRewrite: {}
}
}
}
}