5.2.3 • Published 11 months ago
cdn-cli v5.2.3
通过命令行将文件上传至对象存储,支持阿里云、腾讯云以及七牛云
1. 初始化项目
npx cdn-cli init
2. 配置
module.exports = {
rules: [
{
from: 'dist',
to: '.',
ignore: ['**/*.map', '**/.DS_store'],
noCache: ['**/*.html'],
lastUpload: ['**/*.html'],
},
],
environments: {
production: {
type: 'aliyun',
region: 'oss-cn-hangzhou',
bucket: 'xxx',
accessKeyId: 'xxx',
accessKeySecret: 'xxx',
domain: 'https://xxx.xxx.com',
},
testing: {
type: 'qiniu',
region: '',
bucket: '',
accessKey: '',
secretKey: '',
domain: '',
},
development: {
type: 'tencent',
region: '',
bucket: '',
appId: '',
secretId: '',
secretKey: '',
domain: '',
},
},
};
字段 | 类型 | 详情 |
---|---|---|
rules.from | string | 需要上传的资源目录 |
rules.to | string | 上传目标目录 |
rules.ignore | string[] | 过滤文件或目录 |
rules.noCache | string[] | 不缓存的文件或目录 |
rules.lastUpload | string[] | 最后上传的文件或目录 |
environments | object[] | 环境 |
如果配置文件的参数不存在,系统将从 process.env
中获取值。例如,如果 production
中的 region
值不存在,系统将从 process.env.region
中提取。
3. 发布项目
npx cdn-cli deploy production
npx cdn-cli deploy testing
npx cdn-cli deploy development
...
5.2.3
11 months ago
5.2.2
1 year ago
5.2.1
1 year ago
5.2.0
1 year ago
4.1.3
1 year ago
5.1.1
2 years ago
5.0.6
2 years ago
5.0.5
2 years ago
5.0.4
2 years ago
5.1.0
2 years ago
5.0.3
2 years ago
5.0.2
2 years ago
5.0.1
2 years ago
5.0.0
2 years ago
5.0.0-beta.8
2 years ago
5.0.0-beta.6
2 years ago
5.0.0-beta.7
2 years ago
5.0.0-beta.4
2 years ago
5.0.0-beta.5
2 years ago
5.0.0-beta.2
2 years ago
5.0.0-beta.3
2 years ago
5.0.0-beta.0
2 years ago
5.0.0-beta.1
2 years ago
4.1.2
3 years ago
4.1.0-rc.1
4 years ago
4.1.1
4 years ago
4.1.0-rc.0
4 years ago
4.0.4
4 years ago
4.0.3
4 years ago
4.0.1
4 years ago
4.0.0
4 years ago
4.0.2
4 years ago
4.0.0-alpha.1
4 years ago
3.0.0
6 years ago
2.0.2
7 years ago
2.0.1
7 years ago
2.0.0
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago