Cloud object storage integrate
- Integrate Alibaba Cloud\Huawei Cloud\Tencent Cloud Object Storage to upload static files
npm install cosis --save
//Create a file
cosis.config.json
//Get hash value
hexGenerator()
//Get the cloud object storage access path asynchronous
sourceUrls(hex)
//start operation asynchronous
startOperations()
let hex = hexGenerator(4)
startOperations(hex);
let srcs = sourceUrls()
const fs = require('fs');
const cosis = require('cosis');
let hex = cosis.hexGenerator(4)
cosis.sourceUrls(hex).then((res)=>{
console.log(res)
})
class myPlugin {
apply(compiler) {
compiler.hooks.afterEmit.tapAsync(
{
name: 'MyPlugin',
context: true,
},
(context, compiler, callback) => {
cosis.startOperations(hex)
callback()
}
);
}
}
configureWebpack = {
plugins: [
new myPlugin()
]
}
npm run cosi:test
Node.js
./doc
COSI is available under the MIT license. COSI also includes external libraries that are available under a variety of licenses. See LICENSE for the full license text.