引入
ts
import { buildAndUpload } from 't-comm';
// 不支持 tree-shaking 的项目
import { buildAndUpload} from 't-comm/lib/build-upload/index';
// 只支持 ESM 的项目
import { buildAndUpload} from 't-comm/es/build-upload/index';
buildAndUpload(options)
描述:
打包并上传到服务器
参数:
参数名 | 类型 | 描述 |
---|---|---|
options | object | 配置 |
options.hostName | string | 服务器名称 |
options.hostPwd | string | 服务器密码 |
[options.root] | string | 项目根目录 |
[options.bundleName] | string | 打包文件名称 |
示例
typescript
await buildAndUpload({
hostName: '9.9.9.9',
hostPwd: 'xxxx',
bundleName: 'cron-job-svr',
});