webpack-ks3-oss
v1.0.1
Published
'apload assets file to ks3'
Downloads
1
Readme
webpack-ks3-oss
一个 上传 文件到金山云的webpack 插件
Install
$ npm i webpack-ks3-oss -D
Options
region
: 金山云上传区域AK
: 金山云的授权accessKeyIdSK
: 金山云的授权accessKeySecretbucket
: 远程目标 buckettest
: 测试,
注意: accessKeyId, accessKeySecret
很重要,注意保密!!!
Example
作为webpack插件使用
const WebpackKs3Oss = require('webpack-ks3-oss');
const webpackConfig = {
// ... 省略其他
plugins: [new WebpackKs3Oss({
region: 'BEIJING', // 默认不传为BEIJING
AK: 'your accessKeyId ',
SK: 'your accessKeySecret',
bucket: 'your remote bucket',
Key: 'your remote filename',
filePath: 'the filename you want to upload',
fileSetting: {
isDeep: true // 打开是文件夹上传否则是文件上传
},
ACL: 'public-read' // 资源访问权限
})]
}
独立使用
const WebpackKs3Oss = require('webpack-Ks3-oss');
new WebpackKs3Oss({
region: 'BEIJING', // 默认不传为BEIJING
AK: 'your accessKeyId ',
SK: 'your accessKeySecret',
bucket: 'your remote bucket',
Key: 'your remote filename',
filePath: 'the filename you want to upload',
fileSetting: {
isDeep: true // 打开是文件夹上传否则是文件上传
},
ACL: 'public-read' // 资源访问权限
}).apply();