A grunt tool for uploading static file to aliyun oss.
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');
Type: String
A string value that is your aliyun oss accessKeyId.
Type: String
A string value that is your aliyun oss accessKeySecret.
Type: String
A string value that is your aliyun oss bucket.
Type: String
A string value that is your aliyun oss region.
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']
}
]
}
},
});