How to use the merge-stream.apply function in merge-stream

To help you get started, we’ve selected a few merge-stream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twolfson / twolfson.com / gulpfile.js View on Github external
assert(entries);
    assert.strictEqual(entries.length, 1, 'Expected `browserifyObj` to only have "1" entry ' +
      'but got "' + entries.length + '" entries. Otherwise, we can\'t determine its output name');
    // /home/todd/.../public/js/articles/develop-faster.js -> articles/develop-faster.js
    var jsFilepath = path.relative(__dirname + '/public/js', entries[0]);
    jsStream = jsStream
      .pipe(vinylSourceStream(jsFilepath))
      .pipe(gulpBuffer());

    // Return our JS stream
    return jsStream;
  });

  // Join our files into 1 stream
  // DEV: We use 1 stream so size reports are in the same file
  var jsStream = mergeStream.apply(this, jsStreams);

  // Extract browserify inline sourcemaps into in-memory file
  jsStream = jsStream.pipe(gulpSourcemaps.init({loadMaps: true}));

  // If we are minifying assets, then minify them
  if (config.minifyAssets) {
    jsStream = jsStream
      .pipe(gulpUglify())
      .pipe(gulpSizereport({gzip: true}));
  }

  // Output sourcemaps in-memory to Vinyl file
  jsStream = jsStream.pipe(gulpSourcemaps.write('./'));

  // Return our stream
  return jsStream
github kerrishotts / Mastering-PhoneGap-Code-Package / logology-v12 / gulpfile.all.in.one.js View on Github external
copyAssets: function copyAssets() {
        return merge.apply(merge, ASSETS_TO_COPY.map(function (asset) {
            var fqSourcePath = path.join.apply(path, [SOURCE_DIR].concat(asset.src.split("/")));
            var fqTargetPath = path.join.apply(path, [BUILD_DIR].concat(asset.dest.split("/")));
            return gulp.src([fqSourcePath])
                       .pipe(gulp.dest(fqTargetPath));
        }).concat(projectTasks.copyConfig()))
        .pipe(browserSync.stream());
//
//        return merge(
//                gulp.src(["./build.json"])
//                    .pipe(gulp.dest(path.join(BUILD_DIR))),
//                gulp.src(["./src/www/*.*"])
//                    .pipe(gulp.dest(path.join(BUILD_DIR, "www"))),
//                gulp.src(["./src/www/html/**/*"])
//                    .pipe(gulp.dest(path.join(BUILD_DIR, "www", "html"))),
//                gulp.src(["./src/www/img/**/*"])
//                    .pipe(gulp.dest(path.join(BUILD_DIR, "www", "img"))),
github vigetlabs / blendid / gulp / tasks / browserify.js View on Github external
b.on('update', bundle);
      bundleLogger.watch(bundleConfig.outputName);
    } else {
      // Sort out shared dependencies.
      // b.require exposes modules externally
      if(bundleConfig.require) b.require(bundleConfig.require);
      // b.external excludes modules from the bundle, and expects
      // they'll be available externally
      if(bundleConfig.external) b.external(bundleConfig.external);
    }

    return bundle();
  };

  // Start bundling with Browserify for each bundleConfig specified
  return mergeStream.apply(gulp, _.map(config.bundleConfigs, browserifyThis));

};
github dowjones / gulp-bundle-assets / lib / bundle.js View on Github external
if (bundle.styles) {
      streams.push(gulp.src(bundle.styles, {base: '.'})
        .pipe(using(key, 'css'))
        .pipe(concat(key + '-bundle.css')) // todo src maps
        .pipe(gulp.dest(config.dest)));
    }

    if (bundle.resources) {
      streams.push(gulp.src(bundle.resources, {base: '.'})
        .pipe(using(key))
        .pipe(gulp.dest(config.dest)));
    }

  });

  return merge.apply(merge, streams);
}
github encryptic-team / encryptic / gulps / copy.js View on Github external
return () => {
        return merge.apply(merge, [
            gulp.src([
                './LICENSE',
            ], {base: './'})
            .pipe(gulp.dest($.distDir)),

            // Copy static files like images, locales, etc...
            gulp.src([
                './src/images/**/*.+(png|jpg|gif|ico|icns)',
                './src/docs/**',
                './src/locales/**/*.json',
                './src/.htaccess',
                './src/*.+(xml|ico|txt|webapp)',
                './src/styles/**/*.+(eot|svg|ttf|woff)',
            ], {base: './src'})
            .pipe(gulp.dest($.distDir)),
github Sonoport / soundmodels / Gulpfile.js View on Github external
gulp.task('devbuild',['jsbeautify:src'], function(){

    del([paths.dirs.dist], function () {
        console.log('Cleaning old built assets.');
    });

    var modelStreams = createBundlerStreams(paths.files.modelsSrc, 'dist/models/');
    var effectsStreams = createBundlerStreams(paths.files.effectsSrc, 'dist/effects/');
    var coreStream = createBundlerStreams(paths.files.coreSrc, 'dist/core/');
    var indexStream = gulp.src(paths.files.releaseIndexSrc).pipe(gulp.dest(paths.dirs.dist));

    var combinedStreams = modelStreams.concat(effectsStreams).concat(coreStream).concat(indexStream);

    return merge.apply(this,combinedStreams);
});
github electricjs / electric / lib / tasks / api.js View on Github external
gulp.task(taskPrefix + 'api:layouts', function() {
		var streams = _.map(options.apiConfig.project.refs, function(ref) {
			return gulp.src(path.join(options.pathSrc, 'layouts/*.soy'))
				.pipe(baseInject(options))
				.pipe(gulp.dest(path.join(TEMP_DIR, ref, 'layouts')));
		});

		return mergeStream.apply(this, streams);
	});
github laravel / elixir / ingredients / commands / MergeFiles.js View on Github external
gulp.task(task, function() {
        var collection = config.collections['concatenate'+task];

        return merge.apply(this, collection.map(mergeFiles));
    });
};
github DrewML / GifHub / build / browserify.js View on Github external
gulp.task('browserify', ['clean'], function() {
    const sites = {
        github: 'src/js/sites/GitHub/index.js',
        bitbucket: 'src/js/sites/BitBucket/index.js',
    };

    const streams = Object.keys(sites).forEach(site => (
        browserifyPipe(site, sites[site], 'dist/chrome')
    ));

    return mergeStream.apply(this, streams);
});

merge-stream

Create a stream that emits events from multiple other streams

MIT
Latest version published 5 years ago

Package Health Score

71 / 100
Full package analysis

Similar packages