tm-cli
v0.5.11
Published
> tm-cli v0.5.0 配置API进行大量优化
Downloads
15
Readme
tm-cli
tm-cli v0.5.0 配置API进行大量优化
注意事项
- 老项目生产环境建议用 0.2.0-beta.14 版本构建项目,防止意外构建产生bug!0.2.x 中文文档
安装环境
- node v14.16.1+,npm6.14.12+
使用
// 全局安装
npm i -g tm-cli
// 查看命令
tm
命令参数说明
- tm 查看全部命令
- tm -v 查看版本
- tm i 初始化项目模板选择,构建新的项目(以中后台项目为主)
- tm start 开发环境 默认打开 http://localhost:9090。可选参数 -e 可添加自定义 process.env.APP_ENV 的值,可作为区分应用环境。同时 process.env 中默认内置了版本号的标记和构建时间戳的标记
- tm start --speed --dll 开发环境-极速模式
- 需要index.html中引入外部js css资源 比如 vue.libs.js (vue全家桶依赖库)、vendors.js (第三方依赖库)、element-ui 2.13.0.js 等
- index.html 加入
```
<!--开发环境-dll使用-->
<% if (htmlWebpackPlugin.options.isDll) {%>
<script type="text/javascript" src="./dll/common.dll.js"></script>
<% } %>
```
- tm.config.js
```
// 常用第三方包且不修改开启dll
dll: ['axios','moment','echarts']
```
- tm build 部署构建打包,生成dist目录。可选参数 -e 同上
- tm build --speed 部署环境-极速模式
- 需要index.html中引入外部js css资源 比如 vue.libs.js (vue全家桶依赖库)、vendors.js (第三方依赖库)、element-ui 2.13.0.js 等
- tm watch 开发环境 watch 模式
- tm ssr SSR服务构建打包
- tm mock 本地简单静态服务和 http API 模拟服务
- tm dll 单独构建dll文件
- tm eslint 自动生成统一的eslint, prettier, git hooks配置
- tm update 版本检测更新
- 项目初始化浏览器控制台会打印 process.env 中的配置信息比如版本、构建时间