umi-plugin-oss

2.0.5 • Public • Published

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

Dependencies (1)

Dev Dependencies (12)

Package Sidebar

Install

npm i umi-plugin-oss

Weekly Downloads

24

Version

2.0.5

License

MIT

Unpacked Size

34.7 kB

Total Files

9

Last publish

Collaborators

  • doubaozia
  • imhele