How to use merge2 - 10 common examples

To help you get started, we’ve selected a few merge2 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 neowu / core-ng-project / gradle / node / gulpfile.babel.js View on Github external
configFile: "stylelint.json", // see https://github.com/stylelint/stylelint-config-standard/blob/master/index.js
            reporters: [{
                formatter: "string",
                console: true
            }]
        }))
        .pipe(cssnano({ zindex: false }))
        .pipe(md5(10, `${root}/dist/web/template/**/*.html`, { dirLevel: 2 }))
        .pipe(sourcemaps.write("."))
        .pipe(gulp.dest(`${root}/dist/web/static/css`));

    const libCSS = gulp.src(`${root}/web/static/css/lib/**/*.css`)
        .pipe(md5(10, `${root}/dist/web/template/**/*.html`, { dirLevel: 2 }))
        .pipe(gulp.dest(`${root}/dist/web/static/css/lib`));

    return merge(appCSS, libCSS);
});
github ngUpgraders / ng-forward / gulpfile.babel.js View on Github external
function typescriptToES6(){
	let result = tsBuildProject.src()
		.pipe(sourcemaps.init())
		.pipe(ts(tsBuildProject));

	return merge([
		result.js.pipe(sourcemaps.write()).pipe(gulp.dest('dist/lib')),
		result.dts.pipe(gulp.dest('dist/lib'))
	]);
}
github youzan / create-utils / packages / utils-scripts / src / tasks / build.js View on Github external
function publishGit() {
  return merge(
    gulp.src('package.json').pipe(jsonEditor((json) => {
      const name = { name: `${json.name}${config.target.prefix ? config.target.prefix : ''}`}
      return Object.assign({}, json, { types: './index.d.ts' }, name);
    })),
    gulp.src([config.base.dist + '/**', ...config.base.static, config.base.types + '/**'], { dot: true }),
  ).pipe(
    ghPages({
      branch: config.target.branch,
      cacheDir: config.base.publishCache,
      push: true,
    }),
  );
}
github Skyscanner / backpack / packages / bpk-tokens / gulpfile.babel.js View on Github external
const oldPath = path.resolve(outputPath, `base.${format}`);
        const newPath = path.resolve(
          outputPath,
          `base.${format}`
            .split('ANDROID_')
            .join('')
            .split('IOS_')
            .join(''),
        );
        if (oldPath !== newPath) {
          fs.renameSync(oldPath, newPath);
        }
      });
  });

  gulpMerge(streams).on('finish', done);
};
github ngUpgraders / ng-forward / gulpfile.babel.js View on Github external
function buildCJSDist(){
	let transpile = gulp.src('./dist/es6/**/*.js')
		.pipe(sourcemaps.init({ loadMaps: true }))
		.pipe(babel({ modules: 'common', stage: 0 }))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('./dist/cjs'));

	let move = gulp.src('./dist/es6/**/*.d.ts')
		.pipe(gulp.dest('./dist/cjs'));

	return merge([ transpile, move ]);
}
github neowu / core-ng-project / gradle / node / gulpfile.babel.js View on Github external
.pipe(eslint.format())
        .pipe(eslint.failAfterError())
        .pipe(sourcemaps.init())
        .pipe(babel({
            presets: ["babel-preset-es2015"].map(require.resolve)
        }))
        .pipe(uglify())
        .pipe(md5(10, `${root}/dist/web/template/**/*.html`, { dirLevel: 2 }))
        .pipe(sourcemaps.write("."))
        .pipe(gulp.dest(`${root}/dist/web/static/js`));

    const libJS = gulp.src([`${root}/web/static/js/lib/**/*.js`])
        .pipe(md5(10, `${root}/dist/web/template/**/*.html`, { dirLevel: 2 }))
        .pipe(gulp.dest(`${root}/dist/web/static/js/lib`));

    return merge(appJS, libJS);
});
github googleanalytics / ga-dev-tools / gulpfile.babel.js View on Github external
export const images = () => {
  const basePngs = gulp.src('src/images/**/*.png');

  const smallPngs = basePngs
      .pipe(resize({width: '50%'}))
      .pipe(rename(p => p.basename = p.basename.replace('-2x', '')));

  const pngs = merge2([basePngs, smallPngs])
      .pipe(imagemin({use: [pngquant()]}));

  const svgs = gulp.src('src/images/**/*.svg');

  return merge2([svgs, pngs]).pipe(gulp.dest('public/images'));
};
github SmokeHouseProject / applewood / aurelia_project / tasks / copy-files.js View on Github external
export default function copyFiles(done) {
  if (typeof project.build.copyFiles !== 'object') {
    done();
    return;
  }

  const instructions = getNormalizedInstructions();
  const files = Object.keys(instructions);

  return merge2(files.map(file => {
    let targets = instructions[file];
    if (!Array.isArray(targets)) { targets = [targets]}

    let pipeline = gulp.src(file)
      .pipe(changedInPlace({ firstPass: true }))
    targets.forEach(target => {
      pipeline = pipeline.pipe(gulp.dest(target));
    })

    return pipeline;
  }))
}
github ngUpgraders / ng-forward / gulpfile.babel.js View on Github external
function buildES6Dist(){
	let transpile = gulp.src('./dist/lib/**/*.js')
		.pipe(filter(['**/*', '!**/*.spec.js']))
		.pipe(replace('rxjs-es', 'rxjs'))
		.pipe(gulp.dest('./dist/es6'));

	let move = gulp.src('./dist/lib/**/*.d.ts')
		.pipe(filter(['**/*', '!**/*.spec.d.ts']))
		.pipe(gulp.dest('./dist/es6'));

	return merge([ transpile, move ]);
}
github SmokeHouseProject / applewood / aurelia_project / tasks / push-files.js View on Github external
clean(targets, sources).then(() => {
    return merge2(
      targets.map((target) => {
        return sendFiles(target, sources, instructions)
      })
  )})
  done();

merge2

Merge multiple streams into one stream in sequence or parallel.

MIT
Latest version published 4 years ago

Package Health Score

67 / 100
Full package analysis

Popular merge2 functions