From 56a127fc29994fd0307a17d6bf4f210c551137e5 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Fri, 3 Feb 2023 00:33:31 -0700 Subject: [PATCH] gulpfile: parallel image processing --- gulpfile.js | 4 ++-- package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 3cccbfa..0791b44 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,12 +1,12 @@ /* eslint-disable no-console */ const gulp = require('gulp'); const fs = require('fs'); -const merge = require('merge-stream'); const exec = require('child_process').exec; const log = require('fancy-log'); const parseArgs = require('minimist'); const browserSync = require('browser-sync').create(); const concat = require('gulp-concat'); +const parallel = require('concurrent-transform'); const imageResize = require('gulp-image-resize'); gulp.task('scripts:games', function (callback) { @@ -40,7 +40,7 @@ gulp.task('assets:images', function() { .pipe(imageResize({ width: 400, height: 240, crop: false })) .pipe(gulp.dest('build/images/screenshots/thumbs')); - return merge(baseImages, jumbotronImages, bannerImages, boxartImages, iconImages, screenshotImages); + return parallel(baseImages, jumbotronImages, bannerImages, boxartImages, iconImages, screenshotImages); }); gulp.task('assets:js', function() { diff --git a/package.json b/package.json index dcef97b..ce277e4 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "bootstrap-sass": "^3.4.3", "browser-sync": "^2.27.11", + "concurrent-transform": "^1.0.0", "cssnano": "^5.1.14", "fancy-log": "^2.0.0", "gulp": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 5ce01fb..2fcad6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -825,6 +825,11 @@ concat-with-sourcemaps@^1.0.0: dependencies: source-map "^0.6.1" +concurrent-transform@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/concurrent-transform/-/concurrent-transform-1.0.0.tgz#7a0fdea2f8096239487fdb0addb5edaa7f596f6c" + integrity sha512-k/b+CZJbUQW7A/51ZGFc/bQAbGpUuitvhK0hJi/9vJ7l3QBp5Kib+kSaNnrItDTFLx4pYJqCfN95FTuLUFaZGQ== + config-chain@^1.1.11: version "1.1.13" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4"