Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maelweb/upload-to-qiniu-webpack-plugin
A webpack plugin for upload file to qiniu clound
https://github.com/maelweb/upload-to-qiniu-webpack-plugin
Last synced: about 1 month ago
JSON representation
A webpack plugin for upload file to qiniu clound
- Host: GitHub
- URL: https://github.com/maelweb/upload-to-qiniu-webpack-plugin
- Owner: MaelWeb
- License: mit
- Created: 2018-06-05T02:23:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-22T08:58:17.000Z (over 3 years ago)
- Last Synced: 2024-10-14T21:22:31.951Z (about 1 month ago)
- Language: JavaScript
- Size: 82 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Install
```bash
npm i --save-dev upload-to-qiniu-webpack-plugin
```Usage
This plugin will upload the target file/folder to Qiniu Clound. Just add the plugin to your `webpack`
config as follows:**webpack.config.js**
```js
const UploadToQiniuWebpackPlugin = require('upload-to-qiniu-webpack-plugin');module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
new UploadToQiniuWebpackPlugin({
qiniuAccessKey: 'ARA9LIvdx3JFZyADmwohmNSIjVxgpzIA4',
qiniuSecretKey: 'aK19LEtOfStwsvn5TqkVFnbzxlI5FNU7',
qiniuBucket: 'bucket-test',
qiniuZone: 'Zone_z0',
})
]
}
```Options
You can pass a hash of configuration options to `upload-to-qiniu-webpack-plugin`.
Allowed values are as follows|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|**[`qiniuAccessKey`](#)**|`{String}`|`null`| Your Qiniu AccessKey |
|**[`qiniuSecretKey`](#)**|`{String}`|`null`| Your Qiniu SecretKey |
|**[`qiniuBucket`](#)**|`{String}`|`null`| Your Qiniu Bucket Name |
|**[`qiniuZone`](#)**|`{String}`|`null`| Your Qiniu zone code |
|**[`enabledRefresh`](#)**|`{Boolean}`|`false`| Is enable refresh the file on Qiniu Clound after file upload|
|**[`excludeHtml`](#)**|`{Boolean}`|`true`| Is exclude html file |
|**[`onlyRefreshHtml`](#)**|`{Boolean}`|`false`| only refresh html file (eg: */demo/index.html + */demo/), throws an exception in the case of a failure. |
|**[`prefixPath`](#)**|`{String}`| - | prefix path for the file |
|**[`uploadLogPath`](#)**|`{String}`|[webpackConfig.context](https://webpack.js.org/configuration/entry-context/#context)| Provide a directory where log file should be stored |
|**[`uploadTaget`](#)**|`{String}`|[webpackConfig.output.path](https://webpack.js.org/configuration/output/#output-path)|The target file/folder to upload|About [Zone](https://developer.qiniu.com/kodo/sdk/1289/nodejs):
|Name|value|
|:--:|:----------|
|**[`华东`](#)**| "Zone_z0" |
|**[`华北`](#)**| "Zone_z1" |
|**[`华南`](#)**| "Zone_z2" |
|**[`北美`](#)**| "Zone_na0" |