0.2.0 • Published 7 years ago

grunt-dj-oss-up v0.2.0

Weekly downloads
9
License
-
Repository
github
Last release
7 years ago

grunt-ali-oss-upload

A grunt tool for uploading static file to aliyun oss.

Getting Started

npm install grunt-ali-oss-upload --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-ali-oss-upload');

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"] %>',
                      bucket:'<%= cdn["js.bucket"] %>',
                      region:'<%= cdn["js.region"] %>'
                  },
                  files: [
                      {
                          cwd: '<%= config.view_dest %>',
                          src: ['build/*.js']
                      }
                  ]
              }
          },
});