0

This is not working very well:

gulp.task('dev', function () {
    console.log('concatenating development libs...')

    var log = function (file, cb) {
        console.log(file.path);
        cb(null, file);
    };

    var zocialCss = 'zocial-flat.css';
    request('http://my.blob.core.windows.net/shared-styles-webfonts/zocial-flat.css')
        .pipe(fs2.createWriteStream(zocialCss));

    var cssFiles = [
        './' + zocialCss,
        '../bower_components/**/bootstrap.css',
    ];

    fs.src(cssFiles)
        .pipe(map(log))
        .pipe(concat('styles.css'))
        .pipe(gulp.dest(stylesPath));
});

My guess is fs2.createWriteStream(zocialCss) keeps the file locked (or open for writing) and it never closes, so concat ignores it (or silently fails). I can see zocial-flat.css being generated as expected (I would, by the way, like to delete the file after concatenation).

I have seen alternatives to this approach (like gulp-remote-src) and am open to any such suggestions.

rasx
  • 5,288
  • 2
  • 45
  • 60
  • @rasx, most gulp users are going to use bower/GitHub for sharing CSS and are unlikely to have this problem. – rasx May 13 '15 at 17:59
  • [this question](http://stackoverflow.com/questions/17098400/how-to-chain-write-stream-immediately-with-a-read-stream-in-node-js-0-10) addresses the underlying `createWriteStream()` issue – rasx May 13 '15 at 20:33

0 Answers0