前戏
- vue-cli3项目,对依赖包进行cdn加载的优化。
- 项目顺利启动,控制台报错如下:
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
image.png
正文
- 解决第一步:
方式1:src/main.js
Vue.config.productionTip = false;
设置 Vue.config.productionTip = false 来关闭生产模式下给出的提示
方式2:public/index.html
image.png
-
解决第二步(根本原因):
由于对vue-router进行了cdn
image.png
所以的注释掉
src/router/index.js
image.png
尾声
构建发布压缩到 3分36秒, 未完,还在继续优化中……