umi-plugin-uploadoss
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

umi-plugin-uploadoss

NPM version NPM downloads

Install

$ yarn add umi-plugin-uploadoss -D

Config

在.umirc.ts 或 config/config.ts中配置插件,包括OSS的访问密钥、Bucket等信息

oss: {
  accessKeyId: 'your-accessKeyId',
  accessKeySecret: 'your-accessKeySecret',
  bucket: 'your-bucket-name',
  region: 'your-region',
  endpoint: 'your-bucket-endpoint',
  targetDirectory: 'your-bucket-target-directory',
  outputPath: 'assets',
  deleteOrigin: true,
  minFileSize: 0,
}

API

  • accessKeyId: 这是用于访问OSS的Access Key ID,是一种身份验证凭据,用于标识访问者的身份
  • accessKeySecret: 这是与Access Key ID相对应的Access Key Secret,也是一种身份验证凭据,用于对请求进行签名以确保安全性
  • bucket: 桶的名称
  • region: 存储服务的地域或区域
  • endpoint: 桶的终端节点,一般是桶的地址
  • targetDirectory: 上传到的桶的目录
  • outputPath: 图片资源打包后的导出路径,默认assets
  • deleteOrigin: 可是要在构建后删除原始资源
  • minFileSize: 限制多少大小的资源无需上传,默认 0

LICENSE

MIT

Readme

Keywords

Package Sidebar

Install

npm i umi-plugin-uploadoss

Weekly Downloads

4

Version

0.1.0

License

MIT

Unpacked Size

12.7 kB

Total Files

10

Last publish

Collaborators

  • zson-design