升级 vue-cli
- npm uninstall -g @vue/cli
- npm install -g @vue/cli@4.4.6 --registry=https://registry.npm.taobao.org
常用命令
npm install --registry=https://registry.npm.taobao.org
npm install git+https://github.com/727379048/element.git#dev --registry=https://registry.npm.taobao.org
# 设置淘宝源
npm config get registry
npm config set registry https://registry.npm.taobao.org
npm config get registry
常用依赖
序 | 依赖 | 描述 |
1 | fs-extra | 文件操作相关工具库 |
2 | compression-webpack-plugin | gzip压缩 |
3 | script-ext-html-webpack-plugin | 为 script 设置不同的部署选项进行编译 |
4 | terser-webpack-plugin | 处理 js 的压缩和混淆 |
5 | vue2-ace-editor | 代码编辑器 |
6 | webpack-bundle-analyzer | 打包分析优化 |
常见问题
....
问: You are using the runtime-only build of Vue where the template compiler is not available
答: vue.config.js文件加上webpack的配置
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
}
常见方案
...