1.0.4 • Published 8 years ago

gulp-oss-publish v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

gulp-oss-publish

Publish files with oss

    1. Can publish files with prefix and shortId
    1. Simple
    1. Usable

When genShortId enabled: oss key will be ${prefix}/${shortId}/${filePath}

otherwise oss key should like this ${prefix}/${filePath}

Install

npm install gulp-oss-publish

Use

import publish from 'gulp-oss-publish';

gulp.task('publish', () => 
  gulp
    .src('dist/**/*', {
      base: 'dist',
      buffer: true
    })
    .pipe(publish({
      prefix: 'a/puca-web',
      genShortId: true,
      oss: {
        accessKeyId: 'xxx',
        secretAccessKey: 'yyy',
        endpoint: 'http://oss-cn-hangzhou.aliyuncs.com',
        bucket: 'your-bucket-name'
      },
      headers: {
        CacheControl: 'no-cache',
        ServerSideEncryption: 'AES256'
      }
    }))
);