Skip to content

A plugin for Gulp that uploads files to Aliyun OSS

License

Notifications You must be signed in to change notification settings

wohugb/gulp-aliyunoss

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-aliyunoss

fork from https://github.com/hackrose/gulp-alioss 升级版,改用ali-oss

Aliyun Oss Client for Gulp

Install

npm install gulp-aliyunoss

DEMO

var gulp = require('gulp');
var oss = require('gulp-aliyunoss');
var gulpLoadPlugins = require('gulp-load-plugins');
var plugins = gulpLoadPlugins();

gulp.task('oss', function(){
    return gulp.src([
        './dist/client/app/*',
        './dist/client/bower_components/zeroclipboard/dist/ZeroClipboard.swf'
      ], { base: 'dist/client' })
      .pipe(plugins.alioss({
          accessKeyId: '***',
          accessKeySecret: '******',
          endpoint: 'oss-cn-hangzhou-internal.aliyuncs.com',
          bucket: 'photo',
          prefix: 'serve'
      }));
});

操作结果

cd /path/to/gulpfile.js/
gulp oss
[14:50:59] Using gulpfile ~/path/to/gulpfile.js
[14:50:59] Starting 'oss'...
[14:50:59] Finished 'oss' after *** ms
[14:50:59] OK: assets/a.js
[14:50:59] OK: assets/b/a.js
....

About

A plugin for Gulp that uploads files to Aliyun OSS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%