Giter Club home page Giter Club logo

gulp-qiniu's Introduction

上传静态资源到七牛 CDN

Install

npm install gulp-qiniu --save-dev

Usage

实例代码:

gulp.src('./public/**')
  .pipe(qiniu({
    accessKey: "xxxx",
    secretKey: "xxxx",
    bucket: "bucket",
    private: false
  }, {
    dir: 'assets/',
    versioning: true,
    versionFile: './cdn.json',
    concurrent: 10
  }))

License

MIT

gulp-qiniu's People

Contributors

firesh avatar hfcorriez avatar niettcat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gulp-qiniu's Issues

BUG: extend函数缺少对数组的判断

突然发现html文件上传不了,于是看一下源码,发现有一个ignore参数。
于是就尝试用[]去替换

gulp_qiniu({
  "accessKey": "***",
  "secretKey": "***",
  "bucket": "bucket",
  "private": false
}, {
  "dir": "dest",
  "ignore": []
});

但是ignore不起作用,extend把ignore当成object处理了

Why ignore *.html?

When we perform deployment jobs, it is usual to deploy static files like index.html, especially when it comes to single page web application.

文件夹中文件过大上传会失败, 单独上传一个大文件成功

多个文件上传出现大文件失败:

[09:52:30] Retry(1) → /CodeMart/artboards.js
[09:52:30] Start → /CodeMart/artboards.js
[09:52:30] Error → /CodeMart-Cases/artboards.js socket hang up (req "error"), POST http://up.qiniu.com/ -1 (connected: true, keepalive socket: false, agent status: {"createSocketCount":33,"closeSocketCount":25,"errorSocketCount":0,"time
outSocketCount":14,"requestCount":93,"freeSockets":{"rs.qbox.me:80::":2},"sockets":{"up.qiniu.com:80::":6},"requests":{}})
headers: {}
[09:52:30] Retry(1) → /CodeMart-Cases/artboards.js
[09:52:30] Error → /CodeMart-Club/Club-Homepage.html socket hang up (req "error"), POST http://up.qiniu.com/ -1 (connected: true, keepalive socket: false, agent status: {"createSocketCount":33,"closeSocketCount":26,"errorSocketCount":0,
"timeoutSocketCount":15,"requestCount":93,"freeSockets":{"rs.qbox.me:80::":1},"sockets":{"up.qiniu.com:80::":5,"rs.qbox.me:80::":1},"requests":{}})
headers: {}
[09:52:30] Retry(1) → /CodeMart-Club/Club-Homepage.html
[09:52:30] Start → /CodeMart-Cases/artboards.js
[09:52:30] Start → /CodeMart-Club/Club-Homepage.html

文件 7.1M:

$ ls -alh ./CodeInsight/artboards.js
-rw-rw-r-- 1 xxx xxx 7.1M Jul 11 00:05 ./CodeInsight/artboards.js

单独上传大文件成功:

[09:53:32] Starting 'cdn'...
[09:53:36] Start → /artboards.js
[09:54:14] Upload → /artboards.js
[09:54:14] Total → 1/1

上传完成后gulp直接退出,不继续执行其他任务了

nodejs 版本4.3.1, gulp: 3.9.1

貌似去掉源码里through2.obj的第二个参数就可以了,是我参数不对吗?
var runSequence = require('run-sequence');
gulp.task('cdn', function (done) {
return gulp.src(config.tmp.distAssets)
.pipe(plugins.qiniu({
accessKey: config.qiniu.accessKey,
secretKey: config.qiniu.secretKey,
bucket: config.qiniu.bucket[environment],
private: false
}, {
dir: 'console',
versioning: false,
concurrent: 10
}));
});
gulp.task('build', function(cb) {
runSequence(
'cdn',
'copy',
cb);
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.