Skip to content

引入

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)

描述

打包并上传到服务器

参数

参数名类型描述
optionsobject

配置

options.hostNamestring

服务器名称

options.hostPwdstring

服务器密码

[options.root]string

项目根目录

[options.bundleName]string

打包文件名称

示例

typescript
await buildAndUpload({
  hostName: '9.9.9.9',
  hostPwd: 'xxxx',
  bundleName: 'cron-job-svr',
});