gulp-oss-2
v0.2.1
Published
A plugin for Gulp that uploads files to oss
Downloads
2
Readme
gulp-oss-2
oss plugin for gulp
Usage
First, install gulp-oss-2
as a development dependency:
npm install --save-dev gulp-oss-2
var gulp = require("gulp");
var oss = require("gulp-oss-2");
var gzip = require("gulp-gzip");
gulp.src('./**/*.js')
.pipe(gzip({ append: false }))
.pipe(oss({
"key": "oss key",
"secret": "oss secret",
"endpoint": "http://oss-cn-beijing.aliyuncs.com"
}, {
headers: {
Bucket: 'oss bucket',
CacheControl: 'no-cache', // 参考: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
ContentDisposition: '', // 参考: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
ContentEncoding: 'gzip', // 参考: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
ServerSideEncryption: '',
Expires: ''
},
uploadPath: 'assets/js/'
}));