umi-plugin-rightlyai-oss

Add Umi 3.0 support

Usage no npm install needed!

<script type="module">
  import umiPluginRightlyaiOss from 'https://cdn.skypack.dev/umi-plugin-rightlyai-oss';
</script>

README

umi-plugin-oss

NPM version NPM downloads Build Status Coverage Status License

Add Umi 3.0 support

Just add a plugin into your Umi project, automatically upload productions to OSS@AliCloud !

Usage

$ npm install umi-plugin-oss --save-dev
or
$ yarn add umi-plugin-oss --dev

Add umi-plugin-oss into .umirc.js or config.js of your UmiJS project. UmiJS - Plugin usage

export default {
  oss: Options,
}

Options

Overview

interface Options {
  accessKeyId?: string;
  accessKeySecret?: string;
  acl?: ACLType | ACLRule;
  bijection?: boolean;
  bucket?: {
    cname?: boolean;
    endpoint?: string;
    internal?: boolean;
    name?: string;
    region?: string;
  };
  headers?: {
    'Cache-Control'?: string;
    'Content-Disposition'?: string;
    'Content-Encoding'?: string;
    'Expires'?: string;
    'x-oss-object-acl'?: ACLType;
    'x-oss-server-side-encryption'?: 'AES256' | 'KMS';
    'x-oss-server-side-encryption-key-id'?: string;
    [key: string]: string;
  };
  ignore?: {
    extname?: string[];
    existsInOss?: boolean;
    sizeBetween?: Array<[number, number]>;
  };
  prefix?: string;
  secure?: boolean;
  stsToken?: string;
  timeout?: number;
  waitBeforeDelete?: number;
  waitBeforeUpload?: number;
}

type ACLType = 'public-read-write' | 'public-read' | 'private';

interface ACLRule {
  private?: RegExp | string[];
  publicRead?: RegExp | string[];
  publicReadWrite?: RegExp | string[];
  else?: ACLType;
}

Example

Visit it at examples/base