0.2.7 • Published 4 years ago
@forchange/deploy v0.2.7
deploy
上传文件到 oss(目前只支持 aliyun)
Installing
$ npm install @forchange/deploy
Usage
command
通过 upload
命令上传,命令会自动检测当前执行路径下的 deploy.config.js
文件。
$ upload
require
通过导入模块函数调用。
const { uploadStatic } = require("@forchange/deploy");
uploadStatic({
...config
});
Config
config 为上传操作相关的配置文件
格式如下:
- cdn{Object} ali-oss 配置
- region{String}
- accessKeyId{String}
- accessKeySecret{String}
- bucket{String}
- staticRootPath{String} 静态资源根路径
- include{Array}
- retryMaximum{Number} 重试次数
- chunkLimit{Number} 最大上传并行数
example:
// deploy.config.js
module.exports = {
cdn: {
region: "",
accessKeyId: "",
accessKeySecret: "",
bucket: ""
},
staticRootPath: "path/to/static",
retryMaximum: 3,
chunkLimit: 5,
include: ["/**/*.js"]
};