{"_id":"qiniu-cdn-webpack-plugin","_rev":"325373","name":"qiniu-cdn-webpack-plugin","description":"Webpack plugin for delete & upload & refresh to QiNiu CDN","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"dcatfly","email":"dcatfly@gmail.com"}],"time":{"modified":"2021-06-07T02:44:28.000Z","created":"2018-03-07T04:21:03.340Z","1.1.1":"2018-03-11T08:39:12.889Z","1.1.0":"2018-03-07T06:57:42.588Z","1.0.1":"2018-03-07T04:24:52.820Z","1.0.0":"2018-03-07T04:21:03.340Z"},"users":{},"author":{"name":"dcatlfy"},"repository":{"type":"git","url":"git+https://github.com/Dcatfly/qiniu-cdn-webpack-plugin.git"},"versions":{"1.1.1":{"name":"qiniu-cdn-webpack-plugin","version":"1.1.1","description":"Webpack plugin for delete & upload & refresh to QiNiu CDN","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel ./src/index.js -o ./dist/index.js"},"repository":{"type":"git","url":"git+https://github.com/Dcatfly/qiniu-cdn-webpack-plugin.git"},"keywords":["webpack","plugin","qiniu","cdn","upload","delete","refresh"],"author":{"name":"dcatlfy"},"license":"MIT","bugs":{"url":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin/issues"},"homepage":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin#readme","dependencies":{"lodash.chunk":"^4.2.0","lodash.isfunction":"^3.0.9","ora":"^2.0.0","qiniu":"^7.1.3"},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-stage-1":"^6.24.1"},"gitHead":"ff5b0c19691c64e7b8692730580d3e07f9f85ddc","_id":"qiniu-cdn-webpack-plugin@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"dcatfly","email":"dcatfly@gmail.com"},"dist":{"shasum":"0491a3935614139f06de8c3a27057363c317395a","size":31049,"noattachment":false,"key":"/qiniu-cdn-webpack-plugin/-/qiniu-cdn-webpack-plugin-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/qiniu-cdn-webpack-plugin/download/qiniu-cdn-webpack-plugin-1.1.1.tgz"},"maintainers":[{"name":"dcatfly","email":"dcatfly@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/qiniu-cdn-webpack-plugin_1.1.1_1520757552787_0.1581857239594453"},"_hasShrinkwrap":false,"publish_time":1520757552889,"_cnpm_publish_time":1520757552889},"1.1.0":{"name":"qiniu-cdn-webpack-plugin","version":"1.1.0","description":"Webpack plugin for delete & upload & refresh to QiNiu CDN","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Dcatfly/qiniu-cdn-webpack-plugin.git"},"keywords":["webpack","plugin","qiniu","cdn","upload","delete","refresh"],"author":{"name":"dcatlfy"},"license":"MIT","bugs":{"url":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin/issues"},"homepage":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin#readme","dependencies":{"lodash.chunk":"^4.2.0","lodash.isfunction":"^3.0.9","ora":"^2.0.0","qiniu":"^7.1.3"},"gitHead":"ba11f597ff15ef1638ab41b3bdd2650ec3f505aa","_id":"qiniu-cdn-webpack-plugin@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"dcatfly","email":"dcatfly@gmail.com"},"dist":{"shasum":"8e86ab6163e26209b21b214d9185063f97fb901e","size":7860,"noattachment":false,"key":"/qiniu-cdn-webpack-plugin/-/qiniu-cdn-webpack-plugin-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/qiniu-cdn-webpack-plugin/download/qiniu-cdn-webpack-plugin-1.1.0.tgz"},"maintainers":[{"name":"dcatfly","email":"dcatfly@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/qiniu-cdn-webpack-plugin_1.1.0_1520405861705_0.08661034179207094"},"_hasShrinkwrap":false,"publish_time":1520405862588,"_cnpm_publish_time":1520405862588},"1.0.1":{"name":"qiniu-cdn-webpack-plugin","version":"1.0.1","description":"Webpack plugin for delete & upload & refresh to QiNiu CDN","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Dcatfly/qiniu-cdn-webpack-plugin.git"},"keywords":["webpack","plugin","qiniu","cdn","upload","delete","refresh"],"author":{"name":"dcatlfy"},"license":"MIT","bugs":{"url":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin/issues"},"homepage":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin#readme","dependencies":{"lodash.chunk":"^4.2.0","lodash.isfunction":"^3.0.9","ora":"^2.0.0","qiniu":"^7.1.3"},"gitHead":"66b6fd48be3b8df493068e5240f08b68ba6049ea","_id":"qiniu-cdn-webpack-plugin@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"dcatfly","email":"dcatfly@gmail.com"},"dist":{"shasum":"9675c6425d9faf7cbb71053a72e0d83e6c7567d9","size":7714,"noattachment":false,"key":"/qiniu-cdn-webpack-plugin/-/qiniu-cdn-webpack-plugin-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/qiniu-cdn-webpack-plugin/download/qiniu-cdn-webpack-plugin-1.0.1.tgz"},"maintainers":[{"name":"dcatfly","email":"dcatfly@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/qiniu-cdn-webpack-plugin_1.0.1_1520396692767_0.4952577586587885"},"_hasShrinkwrap":false,"publish_time":1520396692820,"_cnpm_publish_time":1520396692820},"1.0.0":{"name":"qiniu-cdn-webpack-plugin","version":"1.0.0","description":"Webpack plugin for delete & upload & refresh to QiNiu CDN","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Dcatfly/qiniu-cdn-webpack-plugin.git"},"keywords":["webpack","plugin","qiniu","cdn","upload","delete","refresh"],"author":{"name":"dcatlfy"},"license":"MIT","bugs":{"url":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin/issues"},"homepage":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin#readme","dependencies":{"lodash.chunk":"^4.2.0","lodash.isfunction":"^4.2.0","ora":"^2.0.0","qiniu":"^7.1.3"},"gitHead":"acc6ee7c0424b8b49c725181d503af6b44be8341","_id":"qiniu-cdn-webpack-plugin@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"dcatfly","email":"dcatfly@gmail.com"},"dist":{"shasum":"3d4a5aeb08e964074499a0736d9999eed21aeb4e","size":7724,"noattachment":false,"key":"/qiniu-cdn-webpack-plugin/-/qiniu-cdn-webpack-plugin-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/qiniu-cdn-webpack-plugin/download/qiniu-cdn-webpack-plugin-1.0.0.tgz"},"maintainers":[{"name":"dcatfly","email":"dcatfly@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/qiniu-cdn-webpack-plugin_1.0.0_1520396462880_0.13534027254233227"},"_hasShrinkwrap":false,"publish_time":1520396463340,"_cnpm_publish_time":1520396463340}},"readme":"# qiniu-cdn-webpack-plugin\n> 将webpack编译之后的文件上传到七牛云，支持上传前删除bucket中的旧文件，上传之后刷新cdn。\n\n## 特性\n- [x] 支持上传到七牛云指定`bucket`\n- [x] 支持排除指定文件\n- [ ] 支持对比上传\n- [x] 支持上传前清空指定`bucket`\n- [x] 支持上传完成后刷新cdn\n\n## 安装\n```shell\nnpm install --save-dev qiniu-cdn-webpack-plugin\n```\n```shell\nyarn add --dev qiniu-cdn-webpack-plugin\n```\n\n## 使用方法\n\n**本插件最低支持node@6.x 建议使用最新LTS版本 可以使用[n](https://github.com/tj/n)管理node版本**\n\n```js\n//webpack config\nconst Qiniu = require('qiniu-cdn-webpack-plugin')\n\nconst CDN_HOST = `https://static.qiniuxxx.com/`\nmodule.exports = {\n  entry: 'app.js',\n  output: {\n    path: __dirname + '/dist',\n    filename: 'app.[chunkhash].js',\n    //配置webpack打包后插入文件时的cdn\n    publicPath: CDN_HOST\n  },\n  plugins: [\n    new Qiniu({\n        accessKey: 'accessKey',\n        secretKey: 'secretKey',\n        bucket: 'static_bucket',\n        zone: 'Zone_z0',\n        exclude: /\\.html/,\n        refreshCDN: CDN_HOST,\n        refreshFilter: /(a\\.js)|(b\\.js)/\n        clean: true,\n        cleanExclude: /c\\.js/\n    })\n  ]\n}\n```\n## 参数\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|**[`accessKey`](#)**|`{Sring}`||七牛提供的`accessKey`|\n|**[`secretKey`](#)**|`{Sring}`||七牛提供的`secretKey`|\n|**[`bucket`](#)**|`{Sring}`||七牛云存储中的`bucket`|\n|**[`zone`](#)**|`{Sring}`|`Zone_z1`|七牛云存储位置，华东 `Zone_z0`、华北 `Zone_z1`、华南 `Zone_z2`、北美 `Zone_na0`|\n|**[`chunkSize`](#)**|`{Number}`|`20`|每次并行上传的文件个数|\n|**[`exclude`](#)**|`{RegExp}`||要排除的文件名正则规则|\n|**[`refreshCDN`](#)**|`{Sring}`||想要刷新cdn的域名，不填写默认不刷新cdn，填写默认上传完成后刷新此次上传的所有文件|\n|**[`refreshFilter`](#)**|`{RegExp|Function}`||七牛限额每天只能刷新500个文件，通过这个参数可以过滤出想要刷新的文件。|\n|**[`clean`](#)**|`{Boolean}`|false|上传之后，删除七牛云存储`bucket`中的除了本次上传之外的所以文件，防止每次文件名称变动`hash`，产生多余垃圾文件。|\n|**[`cleanExclude`](#)**|`{RegExp|Function}`||通过这个参数可以过滤出七牛中不想清除的文件|\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2018 ZhangZhiheng\n```\n\n","_attachments":{},"homepage":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin#readme","bugs":{"url":"https://github.com/Dcatfly/qiniu-cdn-webpack-plugin/issues"},"license":"MIT"}