mhc-qiniu-tools
v1.0.3
Published
七牛上传工具
Downloads
4
Readme
qiniu-uploader
七牛上传工具
开发环境为
- node:v11.15.0
npm上的对应包名: mhc-qiniu-tools
使用方法:
添加七牛相关配置
配置文件名、目录名,约定为./mhc.config.json
,请在自己的项目文件夹添加该文件。
配置内容包含,七牛的key,和当前项目静态资源的前缀(一般为项目名)。
示例如下:
{
"upload_prefix": "/kaihaoche/h5",
"qiniu": {
"ACCESS_KEY": "123",
"SECRET_KEY": "455"
}
}
npm install mhc-qiniu-tools --save
,然后添加相应的scripts脚本。
执行上传的时候,会默认上传 ./dist/
目录下的所有静态资源。
{
// ...
"scripts": {
"pub_to_qiniu": "mhcToQiniu",
},
// ...
"dependencies": {
"mhc-qiniu-tools": "^1.0.2",
},
// ...
}