Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.
/ umi-plugin-oss Public archive

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

License

Notifications You must be signed in to change notification settings

imhele/umi-plugin-oss

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •