umi-plugin-oss
v2.0.5
Published
[![NPM version](https://img.shields.io/npm/v/umi-plugin-oss.svg?style=flat)](https://npmjs.org/package/umi-plugin-oss) [![NPM downloads](http://img.shields.io/npm/dm/umi-plugin-oss.svg?style=flat)](https://npmjs.org/package/umi-plugin-oss) [![Build Status
Downloads
58
Readme
umi-plugin-oss
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