使用grunt上传文件到阿里云(对ali-oss进行grunt封装)
2016-11-16 19:00
645 查看
grunt-dj-oss-up
A grunt tool for uploading static file to aliyun oss.
Getting
Started
npm install grunt-dj-oss-up --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-dj-oss-up');
The
"oss" task
Options
options.accessKeyId
Type: String
A string value that is your aliyun oss accessKeyId.
options.accessKeySecret
Type: String
A string value that is your aliyun oss accessKeySecret.
options.bucket
Type: String
A string value that is your aliyun oss bucket.
options.region
Type: String
A string value that is your aliyun oss region.
options.objectGen
Type: Function
Default:
function(dest, src){ return [dest, path.basename(src)].join('\/'); }
grunt.initConfig({ oss: { upload:{ options: { accessKeyId:'<%= cdn["js.ak"] %>', accessKeySecret: '<%= cdn["js.sk"] %>'< 4000 /span>, bucket:'<%= cdn["js.bucket"] %>', region:'<%= cdn["js.region"] %>' }, files: [ { cwd: '<%= config.view_dest %>', src: ['build/*.js'] } ] } },});
github地址:https://github.com/z719725611/grunt-dj-oss-up
相关文章推荐
- 在thinkphp中使用阿里云OSS自定义驱动上传文件
- 阿里云OSS 上传文件 删除文件自封装 —python
- 使用WebClient进行上传文件
- 如何使用HttpUnit进行上传文件测试
- 使用spring MVC框架进行文件上传
- struts2学习笔记(10)——使用fileupload进行文件上传
- DiscuzNT使用Silverlight进行多文件上传
- 关于使用sping MVC框架进行文件上传的一点感受
- 使用apache.commons.fileupload等进行文件上传
- 使用edtftpj进行ftp文件上传和下载
- 使用API进行FTP文件上传和下载
- 使用apache的fileupload进行文件上传
- 使用Struts进行文件上传
- 使用spring MVC框架进行文件上传
- 如何使用HttpUnit进行上传文件测试
- AXIS:使用web service进行文件的上传
- DiscuzNT使用Silverlight进行多文件上传
- DiscuzNT使用Silverlight进行多文件上传
- 使用spring MVC框架进行文件上传
- 使用WebClient进行上传文件 [ZT]