npm i --save-dev upyun-webpack-plugin
This is a webpack plugin that integrates upyun-js into webpack, which can implement automatic workflow for upyun file handling.
Upyun upload plugin
const
{UpyunUploadPlugin} = require('upyun-webpack-plugin');
module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
new UpyunUploadPlugin({
serviceName: '<upyun service>',
operatorName: '<upyun operatorname>',
operatorPassword: '<upyun password>',
remotePath: '<remote folder>',
localPath: '<local folder or file>'
}),
]
}
Upyun download plugin
const
{UpyunDownloadPlugin} = require('upyun-webpack-plugin');
module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
new UpyunDownloadPlugin({
serviceName: '<upyun service>',
operatorName: '<upyun operatorname>',
operatorPassword: '<upyun password>',
remotePath: '<remote folder>',
localPath: '<local folder or file>'
}),
]
}
Upyun remove file(s) plugin
const
{UpyunRmPlugin} = require('upyun-webpack-plugin');
module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
new UpyunRmPlugin({
serviceName: '<upyun service>',
operatorName: '<upyun operatorname>',
operatorPassword: '<upyun password>',
remotePath: '<remote folder>',
localPath: '<local folder or file>'
}),
]
}