Skip to content

z719725611/grunt-dj-oss-up

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published